bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] putenv changes to assume C89 or better


From: Paul Eggert
Subject: [Bug-gnulib] putenv changes to assume C89 or better
Date: 09 Sep 2003 21:23:58 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

I installed this:

2003-09-09  Paul Eggert  <address@hidden>

        * putenv.c (malloc): Returns void *, not char *.
        Include <string.h> unconditionally.
        (strchr, memcpy, NULL): Do not define.
        * putenv.m4 (gl_PREREQ_PUTENV): Don't check for string.h, memcpy,
        strchr.

Index: lib/putenv.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/putenv.c,v
retrieving revision 1.26
diff -p -u -r1.26 putenv.c
--- lib/putenv.c        31 Jul 2003 06:27:05 -0000      1.26
+++ lib/putenv.c        10 Sep 2003 03:53:03 -0000
@@ -37,23 +37,15 @@ extern int errno;
    with a non-const argument.  That would conflict with the declaration of
    rpl_putenv below (due to the #define putenv rpl_putenv from config.h).  */
 
-char *malloc ();
+void *malloc ();
 void free ();
 
-#if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H)
-# include <string.h>
-#endif
+#include <string.h>
+
 #if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H)
 # include <unistd.h>
 #endif
 
-#if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR)
-# define strchr index
-#endif
-#if !defined (__GNU_LIBRARY__) && !defined (HAVE_MEMCPY)
-# define memcpy(d,s,n) bcopy ((s), (d), (n))
-#endif
-
 #if HAVE_GNU_LD
 # define environ __environ
 #else
@@ -69,10 +61,6 @@ __libc_lock_define_initialized (static, 
 #else
 # define LOCK
 # define UNLOCK
-#endif
-
-#ifndef NULL
-# define NULL 0
 #endif
 
 static int
Index: m4/putenv.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/putenv.m4,v
retrieving revision 1.11
diff -p -u -r1.11 putenv.m4
--- m4/putenv.m4        31 Dec 2002 13:43:06 -0000      1.11
+++ m4/putenv.m4        10 Sep 2003 03:53:03 -0000
@@ -1,5 +1,5 @@
-# putenv.m4 serial 6
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# putenv.m4 serial 7
+dnl Copyright (C) 2002, 2003 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
 dnl Public License, this file may be distributed as part of a program
@@ -47,7 +47,5 @@ AC_DEFUN([jm_FUNC_PUTENV],
 
 # Prerequisites of lib/putenv.c.
 AC_DEFUN([gl_PREREQ_PUTENV], [
-  AC_CHECK_HEADERS_ONCE(string.h unistd.h)
-  AC_CHECK_FUNCS_ONCE(memcpy)
-  AC_CHECK_FUNCS(strchr)
+  AC_CHECK_HEADERS_ONCE(unistd.h)
 ])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]