summaryrefslogtreecommitdiffstats
path: root/newlib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/locale/nl_langinfo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c
index b2923bd65..8e60c6b21 100644
--- a/newlib/libc/locale/nl_langinfo.c
+++ b/newlib/libc/locale/nl_langinfo.c
@@ -37,10 +37,14 @@
#include "lmonetary.h"
#include "lmessages.h"
+#ifndef __CYGWIN__
#define TRANSITION_PERIOD_HACK
+#endif
#define _REL(BASE) ((int)item-BASE)
+extern char *__locale_charset ();
+
char *
_DEFUN(nl_langinfo, (item),
nl_item item) {
@@ -54,6 +58,9 @@ _DEFUN(nl_langinfo, (item),
switch (item) {
case CODESET:
+#ifdef __CYGWIN__
+ ret = __locale_charset ();
+#else
ret = "";
if ((s = setlocale(LC_CTYPE, NULL)) != NULL) {
if ((cs = strchr(s, '.')) != NULL) {
@@ -92,6 +99,7 @@ _DEFUN(nl_langinfo, (item),
)
ret = "US-ASCII";
}
+#endif /* __CYGWIN__ */
break;
case D_T_FMT:
ret = (char *) __get_current_time_locale()->c_fmt;