public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org, newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Implement GNU extension wcsftime_l
Date: Tue, 23 Aug 2016 15:56:00 -0000	[thread overview]
Message-ID: <20160823155603.65718.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e636fe3d489ca60d171ae1fcf5fabecdd1665af7

commit e636fe3d489ca60d171ae1fcf5fabecdd1665af7
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue Aug 23 17:41:50 2016 +0200

    Implement GNU extension wcsftime_l
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/include/wchar.h | 4 ++++
 newlib/libc/time/strftime.c | 5 ++---
 winsup/cygwin/common.din    | 1 +
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/newlib/libc/include/wchar.h b/newlib/libc/include/wchar.h
index b7f8374..4766ca9 100644
--- a/newlib/libc/include/wchar.h
+++ b/newlib/libc/include/wchar.h
@@ -132,6 +132,10 @@ wchar_t	*_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * ));
 size_t	_EXFUN(wcscspn, (const wchar_t *, const wchar_t *));
 size_t  _EXFUN(wcsftime, (wchar_t *__restrict, size_t,
 				const wchar_t *__restrict, const struct tm *__restrict));
+#if __GNU_VISIBLE
+size_t  wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict,
+		    const struct tm *__restrict, locale_t);
+#endif
 size_t	_EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t));
 size_t	_EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t));
 size_t	_EXFUN(wcslen, (const wchar_t *));
diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c
index 46c2d95..f11a002 100644
--- a/newlib/libc/time/strftime.c
+++ b/newlib/libc/time/strftime.c
@@ -311,6 +311,7 @@ locale, hard-coding the "C" locale settings.
 #  define STRLEN(a)	strlen(a)
 # else
 #  define strftime	wcsftime	/* Alternate function name */
+#  define strftime_l	wcsftime_l	/* Alternate function name */
 #  define CHAR		wchar_t		/* string type basis */
 #  define CQ(a)		L##a		/* character constant qualifier */
 #  define snprintf	swprintf	/* wide-char equivalent function name */
@@ -1460,9 +1461,8 @@ _DEFUN (strftime, (s, maxsize, format, tim_p),
 #endif /* !_WANT_C99_TIME_FORMATS */
 }
 
-#if !defined(MAKE_WCSFTIME)
 size_t
-strftime_l (char *__restrict s, size_t maxsize, const char *__restrict format,
+strftime_l (CHAR *__restrict s, size_t maxsize, const CHAR *__restrict format,
 	    const struct tm *__restrict tim_p, struct __locale_t *locale)
 {
 #ifdef _WANT_C99_TIME_FORMATS
@@ -1479,7 +1479,6 @@ strftime_l (char *__restrict s, size_t maxsize, const char *__restrict format,
   return __strftime (s, maxsize, format, tim_p, locale, NULL, NULL);
 #endif /* !_WANT_C99_TIME_FORMATS */
 }
-#endif
 
 /* The remainder of this file can serve as a regression test.  Compile
  *  with -D_REGRESSION_TEST.  */
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 7fce587..12705fe 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -1522,6 +1522,7 @@ wcscpy NOSIGFE
 wcscspn NOSIGFE
 wcsdup NOSIGFE
 wcsftime SIGFE
+wcsftime_l SIGFE
 wcslcat NOSIGFE
 wcslcpy NOSIGFE
 wcslen NOSIGFE


                 reply	other threads:[~2016-08-23 15:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160823155603.65718.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).