diff options
author | jimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-10-30 10:27:35 +0000 |
---|---|---|
committer | jimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-10-30 10:27:35 +0000 |
commit | 6fb2c4ac7592f6b0d097709daeb7170ed74d0bc0 (patch) | |
tree | e9d6d9b6383b860dfa1caf343096cccdb28ff766 /libc/time | |
parent | ed4a76ca96808ab39057863ff97dcc033eaa5496 (diff) |
* Makeconfig ($(common-objpfx)gnu/option-groups.h): New generated
header.
* scripts/option-groups.awk: New script, to generate it.
* debug/Makefile (CFLAGS-segfault.c): Don't define option group
symbols here.
* wcsmbs/Makefile (CFLAGS-wcsmbsload.c): Same.
* time/Makefile (CFLAGS-strftime_l.c, CFLAGS-strptime_l.c): Same.
* intl/Makefile (CFLAGS-dcigettext.c): Same.
* sysdeps/unix/sysv/linux/Makefile (CFLAGS-gethostid.c)
(CFLAGS-libc_fatal.c): Same.
* misc/Makefile (CFLAGS-error.c, CFLAGS-err.c): Same.
* nss/Makefile (CFLAGS-nsswitch.c, CFLAGS-getnssent_r.c)
(CFLAGS-getent.c): Same.
* string/Makefile (CFLAGS-strerror_l.c): Same.
* iconv/Makefile (CFLAGS-gconv_db.c, CFLAGS-gconv_trans.c)
(CFLAGS-iconv_prog.c): Same.
* locale/Makefile (CFLAGS-C-ctype.c, CFLAGS-xlocale.c)
(CFLAGS-ld-messages.c): Same.
* argp/Makefile (CFLAGS-argp-help.c, CFLAGS-argp-fmtstream.c): Same.
* nptl/Makefile (CFLAGS-pthread_create.c): Same.
* posix/Makefile (CFLAGS-glob.c, CFLAGS-bug-regex1.c): Same.
* stdio-common/Makefile (CFLAGS-printf_fp.c)
(CFLAGS-printf_fphex.c, CFLAGS-fxprintf.c, CFLAGS-tst-popen.c): Same.
* libidn/Makefile (CFLAGS-toutf8.c): Same.
* debug/segfault.c, wcsmbs/wcsmbsload.c, time/strftime_l.c:
* time/strptime_l.c, intl/dcigettext.c:
* sysdeps/unix/sysv/linux/libc_fatal.c:
* sysdeps/unix/sysv/linux/gethostid.c, misc/err.c, misc/error.c:
* nss/getnssent_r.c, nss/nsswitch.c, nss/getent.c:
* string/strerror_l.c, iconv/gconv_db.c, iconv/iconv_prog.c:
* iconv/gconv_trans.c, locale/xlocale.c, locale/C-ctype.c:
* locale/programs/ld-messages.c, argp/argp-help.c:
* argp/argp-fmtstream.c, nptl/pthread_create.c, posix/glob.c:
* posix/bug-regex1.c, stdio-common/printf_fp.c:
* stdio-common/printf_fphex.c, stdio-common/tst-popen.c:
* stdio-common/fxprintf.c, libidn/toutf8.c: #include
<gnu/option-groups.h>, and test for the symbols that #defines,
instead.
git-svn-id: svn://svn.eglibc.org/trunk@4026 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/time')
-rw-r--r-- | libc/time/Makefile | 6 | ||||
-rw-r--r-- | libc/time/strftime_l.c | 12 | ||||
-rw-r--r-- | libc/time/strptime_l.c | 11 |
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); |