From e76326b7a4aecb5051fc6e5859a0a54d98f1d152 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 7 Aug 2004 02:58:12 +0000 Subject: [PATCH] Only declare strdup if it isn't declared by the system. --- lib/ChangeLog | 29 +++++++++++++++-------------- lib/strdup.h | 2 +- m4/ChangeLog | 12 ++++++++---- m4/strdup.m4 | 13 +++++-------- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index eed8bc39e2..5dd865b6e3 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -20,20 +20,6 @@ xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c: Import changes from coreutils. -2004-08-03 Simon Josefsson - - * progname.h: Don't include stdbool.h. - -2004-08-01 Simon Josefsson - - * xgetdomainname.c: Include stdlib.h, for free(). - -2004-08-02 Simon Josefsson - - * getsubopt.h: New file, with comments from Bruno Haible. - * getsubopt.c: New file, from glibc, but slightly modified based on - suggestions from Paul Eggert . - 2004-08-05 Paul Eggert Merge from coreutils. @@ -81,6 +67,21 @@ * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or working. +2004-08-03 Simon Josefsson + + * strdup.h: Only use HAVE_DECL_STRDUP if defined. + * progname.h: Don't include stdbool.h. + +2004-08-02 Simon Josefsson + + * getsubopt.h: New file, with comments from Bruno Haible. + * getsubopt.c: New file, from glibc, but slightly modified based on + suggestions from Paul Eggert . + +2004-08-01 Simon Josefsson + + * xgetdomainname.c: Include stdlib.h, for free(). + 2004-07-16 Simon Josefsson * dummy.c: New file. diff --git a/lib/strdup.h b/lib/strdup.h index 4dc6a391c8..d58bd13e26 100644 --- a/lib/strdup.h +++ b/lib/strdup.h @@ -21,7 +21,7 @@ /* Get strdup declaration, if available. */ #include -#if !HAVE_DECL_STRDUP && !defined strdup +#if defined HAVE_DECL_STRDUP && !HAVE_DECL_STRDUP && !defined strdup /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *s); #endif diff --git a/m4/ChangeLog b/m4/ChangeLog index 62527eb0cc..aa73c931b5 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -7,10 +7,6 @@ fsusage.m4, jm-macros.m4, ls-mntd-fs.m4, md5.m4, mountlist.m4, prereq.m4, sha.m4: Import changes from coreutils. -2004-08-02 Simon Josefsson - - * getsubopt.m4: New file. - 2004-08-05 Paul Eggert Merge from coreutils. @@ -30,6 +26,14 @@ prerequisite modules now handle the DOS stuff. Don't check for unistd.h. +2004-08-03 Simon Josefsson + + * strdup.m4: Always run gl_PREREQ_STRDUP, since strdup.h need it. + +2004-08-02 Simon Josefsson + + * getsubopt.m4: New file. + 2004-08-03 Paul Eggert * fatal.m4: Remove, as the "fatal" module wasn't used or working. diff --git a/m4/strdup.m4 b/m4/strdup.m4 index 6e64bc80fc..9964d15b10 100644 --- a/m4/strdup.m4 +++ b/m4/strdup.m4 @@ -1,4 +1,4 @@ -# strdup.m4 serial 3 +# strdup.m4 serial 4 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -9,12 +9,9 @@ dnl the same distribution terms as the rest of that program. AC_DEFUN([gl_FUNC_STRDUP], [ AC_REPLACE_FUNCS(strdup) - if test $ac_cv_func_strdup = no; then - gl_PREREQ_STRDUP - fi + AC_CHECK_DECLS_ONCE(strdup) + gl_PREREQ_STRDUP ]) -# Prerequisites of lib/strdup.h and lib/strdup.c. -AC_DEFUN([gl_PREREQ_STRDUP], [ - AC_CHECK_DECLS(strdup) -]) +# Prerequisites of lib/strdup.c. +AC_DEFUN([gl_PREREQ_STRDUP], [:]) -- 2.30.2