From d23630c01b90cbd1b713598f3c2c1b06400061b0 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 10 Sep 2009 14:10:41 -0600 Subject: [PATCH] stdlib: sort witness names * modules/stdlib (Makefile.am): Sort replacements. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. * lib/stdlib.in.h: Likewise. Signed-off-by: Eric Blake --- ChangeLog | 5 +++ lib/stdlib.in.h | 114 ++++++++++++++++++++++++-------------------------------- m4/stdlib_h.m4 | 12 +++--- modules/stdlib | 12 +++--- 4 files changed, 65 insertions(+), 78 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c26b00ed..8f4708f12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-09-16 Eric Blake + stdlib: sort witness names + * modules/stdlib (Makefile.am): Sort replacements. + * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. + * lib/stdlib.in.h: Likewise. + parse-duration-tests: avoid link failure * modules/parse-duration-tests (test_parse_duration_LDADD): Add LIBINTL. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 9ac719956..f05962ea5 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -87,37 +87,20 @@ struct random_data extern "C" { #endif - -#if @GNULIB_MALLOC_POSIX@ -# if !@HAVE_MALLOC_POSIX@ -# undef malloc -# define malloc rpl_malloc -extern void * malloc (size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef malloc -# define malloc(s) \ - (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ - "use gnulib module malloc-posix for portability"), \ - malloc (s)) -#endif - - -#if @GNULIB_REALLOC_POSIX@ -# if !@HAVE_REALLOC_POSIX@ -# undef realloc -# define realloc rpl_realloc -extern void * realloc (void *ptr, size_t size); +#if @GNULIB_ATOLL@ +# if !@HAVE_ATOLL@ +/* Parse a signed decimal integer. + Returns the value of the integer. Errors are not detected. */ +extern long long atoll (const char *string); # endif #elif defined GNULIB_POSIXCHECK -# undef realloc -# define realloc(p,s) \ - (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ - "use gnulib module realloc-posix for portability"), \ - realloc (p, s)) +# undef atoll +# define atoll(s) \ + (GL_LINK_WARNING ("atoll is unportable - " \ + "use gnulib module atoll for portability"), \ + atoll (s)) #endif - #if @GNULIB_CALLOC_POSIX@ # if !@HAVE_CALLOC_POSIX@ # undef calloc @@ -132,22 +115,6 @@ extern void * calloc (size_t nmemb, size_t size); calloc (n, s)) #endif - -#if @GNULIB_ATOLL@ -# if !@HAVE_ATOLL@ -/* Parse a signed decimal integer. - Returns the value of the integer. Errors are not detected. */ -extern long long atoll (const char *string); -# endif -#elif defined GNULIB_POSIXCHECK -# undef atoll -# define atoll(s) \ - (GL_LINK_WARNING ("atoll is unportable - " \ - "use gnulib module atoll for portability"), \ - atoll (s)) -#endif - - #if @GNULIB_GETLOADAVG@ # if !@HAVE_DECL_GETLOADAVG@ /* Store max(NELEM,3) load average numbers in LOADAVG[]. @@ -164,7 +131,6 @@ extern int getloadavg (double loadavg[], int nelem); getloadavg (l, n)) #endif - #if @GNULIB_GETSUBOPT@ /* Assuming *OPTIONP is a comma separated list of elements of the form "token" or "token=value", getsubopt parses the first of these elements. @@ -188,6 +154,19 @@ extern int getsubopt (char **optionp, char *const *tokens, char **valuep); getsubopt (o, t, v)) #endif +#if @GNULIB_MALLOC_POSIX@ +# if !@HAVE_MALLOC_POSIX@ +# undef malloc +# define malloc rpl_malloc +extern void * malloc (size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef malloc +# define malloc(s) \ + (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ + "use gnulib module malloc-posix for portability"), \ + malloc (s)) +#endif #if @GNULIB_MKDTEMP@ # if !@HAVE_MKDTEMP@ @@ -206,7 +185,6 @@ extern char * mkdtemp (char * /*template*/); mkdtemp (t)) #endif - #if @GNULIB_MKOSTEMP@ # if !@HAVE_MKOSTEMP@ /* Create a unique temporary file from TEMPLATE. @@ -231,7 +209,6 @@ extern int mkostemp (char * /*template*/, int /*flags*/); mkostemp (t, f)) #endif - #if @GNULIB_MKSTEMP@ # if @REPLACE_MKSTEMP@ /* Create a unique temporary file from TEMPLATE. @@ -257,7 +234,6 @@ extern int mkstemp (char * /*template*/); mkstemp (t)) #endif - #if @GNULIB_PUTENV@ # if @REPLACE_PUTENV@ # undef putenv @@ -266,7 +242,6 @@ extern int putenv (char *string); # endif #endif - #if @GNULIB_RANDOM_R@ # if !@HAVE_RANDOM_R@ @@ -303,6 +278,19 @@ int random_r (struct random_data *buf, int32_t *result); setstate_r (a,r)) #endif +#if @GNULIB_REALLOC_POSIX@ +# if !@HAVE_REALLOC_POSIX@ +# undef realloc +# define realloc rpl_realloc +extern void * realloc (void *ptr, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef realloc +# define realloc(p,s) \ + (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ + "use gnulib module realloc-posix for portability"), \ + realloc (p, s)) +#endif #if @GNULIB_RPMATCH@ # if !@HAVE_RPMATCH@ @@ -318,7 +306,6 @@ extern int rpmatch (const char *response); rpmatch (r)) #endif - #if @GNULIB_SETENV@ # if !@HAVE_SETENV@ /* Set NAME to VALUE in the environment. @@ -327,21 +314,6 @@ extern int setenv (const char *name, const char *value, int replace); # endif #endif - -#if @GNULIB_UNSETENV@ -# if @HAVE_UNSETENV@ -# if @VOID_UNSETENV@ -/* On some systems, unsetenv() returns void. - This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ -# define unsetenv(name) ((unsetenv)(name), 0) -# endif -# else -/* Remove the variable NAME from the environment. */ -extern int unsetenv (const char *name); -# endif -#endif - - #if @GNULIB_STRTOD@ # if @REPLACE_STRTOD@ # define strtod rpl_strtod @@ -358,7 +330,6 @@ extern double strtod (const char *str, char **endp); strtod (s, e)) #endif - #if @GNULIB_STRTOLL@ # if !@HAVE_STRTOLL@ /* Parse a signed integer whose textual representation starts at STRING. @@ -379,7 +350,6 @@ extern long long strtoll (const char *string, char **endptr, int base); strtoll (s, e, b)) #endif - #if @GNULIB_STRTOULL@ # if !@HAVE_STRTOULL@ /* Parse an unsigned integer whose textual representation starts at STRING. @@ -400,6 +370,18 @@ extern unsigned long long strtoull (const char *string, char **endptr, int base) strtoull (s, e, b)) #endif +#if @GNULIB_UNSETENV@ +# if @HAVE_UNSETENV@ +# if @VOID_UNSETENV@ +/* On some systems, unsetenv() returns void. + This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ +# define unsetenv(name) ((unsetenv)(name), 0) +# endif +# else +/* Remove the variable NAME from the environment. */ +extern int unsetenv (const char *name); +# endif +#endif #ifdef __cplusplus } diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 89ac97fb9..b7cf18c3f 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 16 +# stdlib_h.m4 serial 17 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,17 +33,17 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ - GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) - GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) - GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) + GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) + GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) + GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) @@ -53,12 +53,13 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) + HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) - HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) + HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) @@ -67,7 +68,6 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) - HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) diff --git a/modules/stdlib b/modules/stdlib index c19d7d68e..b15f9ae0b 100644 --- a/modules/stdlib +++ b/modules/stdlib @@ -26,18 +26,17 @@ stdlib.h: stdlib.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ - -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ - -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ - -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ - -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ + -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ + -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ @@ -46,12 +45,14 @@ stdlib.h: stdlib.in.h -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ - -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ @@ -60,7 +61,6 @@ stdlib.h: stdlib.in.h -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ - -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -- 2.11.0