changeset 4683:4452e4c45cc4

Assume ANSI C <string.h>, <stdlib.h>.
author Bruno Haible <bruno@clisp.org>
date Wed, 10 Sep 2003 14:16:32 +0000
parents 90abbdf08583
children 318c378b409b
files lib/ChangeLog lib/setenv.c lib/unsetenv.c m4/ChangeLog m4/setenv.m4
diffstat 5 files changed, 27 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,12 @@
+2003-09-10  Bruno Haible  <bruno@clisp.org>
+
+	* strcspn.c: Include <string.h> unconditionally.
+	* strpbrk.c: Include <string.h> unconditionally.
+	* strstr.c: Include <string.h> unconditionally.
+	* unicodeio.c: Include <string.h> unconditionally.
+	* setenv.c: Include <stdlib.h> and <string.h> unconditionally.
+	* unsetenv.c: Likewise.
+
 2003-09-10  Jim Meyering  <jim@meyering.net>
 
 	* error.c: Correct indentation of cpp directives.
--- a/lib/setenv.c
+++ b/lib/setenv.c
@@ -28,12 +28,8 @@
 # define __set_errno(ev) ((errno) = (ev))
 #endif
 
-#if _LIBC || HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if _LIBC || HAVE_STRING_H
-# include <string.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
 #if _LIBC || HAVE_UNISTD_H
 # include <unistd.h>
 #endif
--- a/lib/unsetenv.c
+++ b/lib/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-1999,2000-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -27,12 +27,8 @@
 # define __set_errno(ev) ((errno) = (ev))
 #endif
 
-#if _LIBC || HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if _LIBC || HAVE_STRING_H
-# include <string.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
 #if _LIBC || HAVE_UNISTD_H
 # include <unistd.h>
 #endif
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,12 @@
+2003-09-10  Bruno Haible  <bruno@clisp.org>
+
+	* strcspn.m4 (gl_PREREQ_STRCSPN): Remove <string.h> check.
+	* strpbrk.m4 (gl_PREREQ_STRPBRK): Remove <string.h> check.
+	* strstr.m4 (gl_PREREQ_STRSTR): Remove <string.h> check.
+	* unicodeio.m4 (gl_UNICODEIO): Remove <string.h> check.
+	* setenv.m4 (gl_PREREQ_SETENV, gl_PREREQ_UNSETENV): Remove
+	<stdlib.h> and <string.h> checks.
+
 2003-09-09  Paul Eggert  <eggert@twinsun.com>
 
 	* getcwd.m4 (AC_FUNC_GETCWD_NULL): Don't check for stdlib.h.
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 3
-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+# setenv.m4 serial 4
+dnl Copyright (C) 2001-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
@@ -40,7 +40,7 @@
 AC_DEFUN([gl_PREREQ_SETENV],
 [
   AC_REQUIRE([AC_FUNC_ALLOCA])
-  AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h)
+  AC_CHECK_HEADERS_ONCE(unistd.h)
   AC_CHECK_HEADERS(search.h)
   AC_CHECK_FUNCS(tsearch)
   gt_CHECK_VAR_DECL([#include <errno.h>], errno)
@@ -50,7 +50,7 @@
 # Prerequisites of lib/unsetenv.c.
 AC_DEFUN([gl_PREREQ_UNSETENV],
 [
-  AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h)
+  AC_CHECK_HEADERS_ONCE(unistd.h)
   gt_CHECK_VAR_DECL([#include <errno.h>], errno)
   gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
 ])