From: Daniel Sabogal <dsabogalcc@gmail.com>
To: musl@lists.openwall.com
Subject: [PATCH] add missing *_unlocked and wcsftime_l prototypes to wchar.h
Date: Tue, 6 Sep 2016 17:09:39 -0400 [thread overview]
Message-ID: <20160906210939.32637-2-dsabogalcc@gmail.com> (raw)
In-Reply-To: <20160906210939.32637-1-dsabogalcc@gmail.com>
these functions had been implemented, but prototypes were not made available
---
include/wchar.h | 12 ++++++++++++
src/stdio/getwchar.c | 2 --
src/stdio/getwchar_unlocked.c | 8 ++++++++
src/stdio/putwchar.c | 2 --
src/stdio/putwchar_unlocked.c | 8 ++++++++
5 files changed, 28 insertions(+), 4 deletions(-)
create mode 100644 src/stdio/getwchar_unlocked.c
create mode 100644 src/stdio/putwchar_unlocked.c
diff --git a/include/wchar.h b/include/wchar.h
index 0167dce..58818f6 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -136,6 +136,18 @@ size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const s
#undef iswdigit
+#if defined(_GNU_SOURCE)
+wint_t fgetwc_unlocked (FILE *);
+wint_t getwc_unlocked (FILE *);
+wint_t getwchar_unlocked (void);
+wint_t fputwc_unlocked (wchar_t, FILE *);
+wint_t putwc_unlocked (wchar_t, FILE *);
+wint_t putwchar_unlocked (wchar_t);
+wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict);
+int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict);
+size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t);
+#endif
+
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
FILE *open_wmemstream(wchar_t **, size_t *);
diff --git a/src/stdio/getwchar.c b/src/stdio/getwchar.c
index bd89e0e..77a9dc1 100644
--- a/src/stdio/getwchar.c
+++ b/src/stdio/getwchar.c
@@ -5,5 +5,3 @@ wint_t getwchar(void)
{
return fgetwc(stdin);
}
-
-weak_alias(getwchar, getwchar_unlocked);
diff --git a/src/stdio/getwchar_unlocked.c b/src/stdio/getwchar_unlocked.c
new file mode 100644
index 0000000..1d00567
--- /dev/null
+++ b/src/stdio/getwchar_unlocked.c
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include "stdio_impl.h"
+#include <wchar.h>
+
+wint_t getwchar_unlocked(void)
+{
+ return fgetwc_unlocked(stdin);
+}
diff --git a/src/stdio/putwchar.c b/src/stdio/putwchar.c
index b249c4a..7575384 100644
--- a/src/stdio/putwchar.c
+++ b/src/stdio/putwchar.c
@@ -5,5 +5,3 @@ wint_t putwchar(wchar_t c)
{
return fputwc(c, stdout);
}
-
-weak_alias(putwchar, putwchar_unlocked);
diff --git a/src/stdio/putwchar_unlocked.c b/src/stdio/putwchar_unlocked.c
new file mode 100644
index 0000000..6817f9e
--- /dev/null
+++ b/src/stdio/putwchar_unlocked.c
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include "stdio_impl.h"
+#include <wchar.h>
+
+wint_t putwchar_unlocked(wchar_t c)
+{
+ return fputwc_unlocked(c, stdout);
+}
--
2.10.0
next prev parent reply other threads:[~2016-09-06 21:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 21:09 Daniel Sabogal
2016-09-06 21:09 ` Daniel Sabogal [this message]
2016-09-09 23:02 ` Rich Felker
2016-09-10 0:42 ` Daniel Sabogal
2016-09-10 1:01 ` Rich Felker
2016-09-10 1:23 ` Daniel Sabogal
2016-09-16 22:19 ` Rich Felker
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=20160906210939.32637-2-dsabogalcc@gmail.com \
--to=dsabogalcc@gmail.com \
--cc=musl@lists.openwall.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).