summaryrefslogtreecommitdiff
path: root/libc/time
diff options
context:
space:
mode:
Diffstat (limited to 'libc/time')
-rw-r--r--libc/time/Makefile6
-rw-r--r--libc/time/strftime_l.c12
-rw-r--r--libc/time/strptime_l.c11
3 files changed, 14 insertions, 15 deletions
diff --git a/libc/time/Makefile b/libc/time/Makefile
index 5d0f7ff58..78e127da8 100644
--- a/libc/time/Makefile
+++ b/libc/time/Makefile
@@ -54,12 +54,6 @@ CFLAGS-tzfile.c = $(tz-cflags)
CFLAGS-tzset.c = $(tz-cflags)
CFLAGS-getdate.c = -fexceptions
-OPTION_EGLIBC_LOCALE_CODE-CFLAGS-$(OPTION_EGLIBC_LOCALE_CODE) \
- = -DOPTION_EGLIBC_LOCALE_CODE
-
-CFLAGS-strftime_l.c = $(OPTION_EGLIBC_LOCALE_CODE-CFLAGS-y)
-CFLAGS-strptime_l.c = $(OPTION_EGLIBC_LOCALE_CODE-CFLAGS-y)
-
# Don't warn about Y2k problem in strftime format string.
CFLAGS-test_time.c = -Wno-format
diff --git a/libc/time/strftime_l.c b/libc/time/strftime_l.c
index 31e934e0b..eb8f06ce6 100644
--- a/libc/time/strftime_l.c
+++ b/libc/time/strftime_l.c
@@ -35,6 +35,10 @@
# include "../locale/localeinfo.h"
#endif
+#ifdef _LIBC
+# include <gnu/option-groups.h>
+#endif
+
#if defined emacs && !defined HAVE_BCOPY
# define HAVE_MEMCPY 1
#endif
@@ -896,7 +900,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
goto bad_format;
if (modifier == L_('E'))
{
-#if defined (OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
if (era)
{
@@ -969,7 +973,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
if (modifier == L_('O') && 0 <= number_value)
{
-#if defined (OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
/* Get the locale specific alternate representation of
the number NUMBER_VALUE. If none exist NULL is returned. */
const CHAR_T *cp = nl_get_alt_digit (number_value
@@ -1274,7 +1278,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
case L_('Y'):
if (modifier == 'E')
{
-#if defined (OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
if (era)
{
@@ -1299,7 +1303,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
case L_('y'):
if (modifier == L_('E'))
{
-#if defined (OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
if (era)
{
diff --git a/libc/time/strptime_l.c b/libc/time/strptime_l.c
index c1224adc9..c089b30ef 100644
--- a/libc/time/strptime_l.c
+++ b/libc/time/strptime_l.c
@@ -29,6 +29,7 @@
#include <stdbool.h>
#ifdef _LIBC
+# include <gnu/option-groups.h>
# include "../locale/localeinfo.h"
#endif
@@ -93,7 +94,7 @@ localtime_r (t, tp)
if (val < from || val > to) \
return NULL; \
} while (0)
-#if defined (OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
# define get_alt_number(from, to, n) \
({ \
__label__ do_normal; \
@@ -828,7 +829,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
s.want_xday = 1;
break;
case 'C':
-#ifdef OPTION_EGLIBC_LOCALE_CODE
+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
if (s.decided != raw)
{
if (s.era_cnt >= 0)
@@ -870,7 +871,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
normal representation. */
goto match_century;
case 'y':
-#ifdef OPTION_EGLIBC_LOCALE_CODE
+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
if (s.decided != raw)
{
get_number(0, 9999, 4);
@@ -932,7 +933,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
#endif
goto match_year_in_century;
case 'Y':
-#ifdef OPTION_EGLIBC_LOCALE_CODE
+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
if (s.decided != raw)
{
num_eras = _NL_CURRENT_WORD (LC_TIME,
@@ -1132,7 +1133,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
tm->tm_year = (s.century - 19) * 100;
}
-#ifdef OPTION_EGLIBC_LOCALE_CODE
+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
if (s.era_cnt != -1)
{
era = _nl_select_era_entry (s.era_cnt HELPER_LOCALE_ARG);