Only declare strdup if it isn't declared by the system.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 7 Aug 2004 02:58:12 +0000 (02:58 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 7 Aug 2004 02:58:12 +0000 (02:58 +0000)
lib/ChangeLog
lib/strdup.h
m4/ChangeLog
m4/strdup.m4

index eed8bc39e230b89eb7890b1cce7c152c7eb98512..5dd865b6e308d1f4539108e178ba7bb81e052af3 100644 (file)
        xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
        Import changes from coreutils.
 
-2004-08-03  Simon Josefsson  <jas@extundo.com>
-
-       * progname.h: Don't include stdbool.h.
-
-2004-08-01  Simon Josefsson  <jas@extundo.com>
-
-       * xgetdomainname.c: Include stdlib.h, for free().
-
-2004-08-02  Simon Josefsson  <jas@extundo.com>
-
-       * getsubopt.h: New file, with comments from Bruno Haible.
-       * getsubopt.c: New file, from glibc, but slightly modified based on
-       suggestions from Paul Eggert <eggert@cs.ucla.edu>.
-
 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        Merge from coreutils.
        * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
        working.
 
+2004-08-03  Simon Josefsson  <jas@extundo.com>
+
+       * strdup.h: Only use HAVE_DECL_STRDUP if defined.
+       * progname.h: Don't include stdbool.h.
+
+2004-08-02  Simon Josefsson  <jas@extundo.com>
+
+       * getsubopt.h: New file, with comments from Bruno Haible.
+       * getsubopt.c: New file, from glibc, but slightly modified based on
+       suggestions from Paul Eggert <eggert@cs.ucla.edu>.
+
+2004-08-01  Simon Josefsson  <jas@extundo.com>
+
+       * xgetdomainname.c: Include stdlib.h, for free().
+
 2004-07-16  Simon Josefsson  <jas@extundo.com>
 
        * dummy.c: New file.
index 4dc6a391c8aeb80f9d4b6c464e519336cf6b5e00..d58bd13e260874fb8b1d864e94740278b1fd524d 100644 (file)
@@ -21,7 +21,7 @@
 /* Get strdup declaration, if available.  */
 #include <string.h>
 
-#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
index 62527eb0ccebed777286a654f65f4ca2af8e43b4..aa73c931b575816ac67e60989289e1d96fd80dcc 100644 (file)
@@ -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  <jas@extundo.com>
-
-       * getsubopt.m4: New file.
-
 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        Merge from coreutils.
        prerequisite modules now handle the DOS stuff.
        Don't check for unistd.h.
 
+2004-08-03  Simon Josefsson  <jas@extundo.com>
+
+       * strdup.m4: Always run gl_PREREQ_STRDUP, since strdup.h need it.
+
+2004-08-02  Simon Josefsson  <jas@extundo.com>
+
+       * getsubopt.m4: New file.
+
 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        * fatal.m4: Remove, as the "fatal" module wasn't used or working.
index 6e64bc80fc3d1d6c7045b44c3f0ee2a454408e13..9964d15b1078dd061c09437d98daf5aa2156cf04 100644 (file)
@@ -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], [:])