[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] strdup: fix warnings
From: |
Simon Josefsson |
Subject: |
[Bug-gnulib] strdup: fix warnings |
Date: |
Tue, 03 Aug 2004 23:50:08 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
strdup.h generated warnings on platforms that have strdup, since the
AC_CHECK_DECLS(strdup) call was only invoked when strdup was missing.
This fixes both the m4, and the header file.
Perhaps it is bad style to always invoke gl_PREREQ_*, I'm not sure
about that.
2004-08-03 Simon Josefsson <address@hidden>
* strdup.h: Only use HAVE_DECL_STRDUP if defined.
2004-08-03 Simon Josefsson <address@hidden>
* strdup.m4: Always run gl_PREREQ_STRDUP, since strdup.h need it.
Index: strdup.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/strdup.h,v
retrieving revision 1.1
diff -u -p -u -w -r1.1 strdup.h
--- strdup.h 25 Feb 2004 19:46:30 -0000 1.1
+++ strdup.h 3 Aug 2004 21:48:08 -0000
@@ -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: strdup.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/strdup.m4,v
retrieving revision 1.3
diff -u -p -u -w -r1.3 strdup.m4
--- strdup.m4 25 Feb 2004 19:39:07 -0000 1.3
+++ strdup.m4 3 Aug 2004 21:47:26 -0000
@@ -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,9 +9,7 @@ dnl the same distribution terms as the r
AC_DEFUN([gl_FUNC_STRDUP],
[
AC_REPLACE_FUNCS(strdup)
- if test $ac_cv_func_strdup = no; then
gl_PREREQ_STRDUP
- fi
])
# Prerequisites of lib/strdup.h and lib/strdup.c.
- [Bug-gnulib] strdup: fix warnings,
Simon Josefsson <=