bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] setenv patch to assume C89 or better


From: Bruno Haible
Subject: [Bug-gnulib] setenv patch to assume C89 or better
Date: Wed, 10 Sep 2003 16:15:16 +0200
User-agent: KMail/1.5

I installed this patch.

        * lib/setenv.c: Include <stdlib.h> and <string.h> unconditionally.
        * lib/unsetenv.c: Likewise.
        * m4/setenv.m4 (gl_PREREQ_SETENV, gl_PREREQ_UNSETENV): Remove
        <stdlib.h> and <string.h> checks.

*** lib/setenv.c        14 Jul 2003 22:44:04 -0000      1.7
--- lib/setenv.c        10 Sep 2003 13:47:01 -0000
***************
*** 28,39 ****
  # 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
  #if _LIBC || HAVE_UNISTD_H
  # include <unistd.h>
  #endif
--- 28,35 ----
  # define __set_errno(ev) ((errno) = (ev))
  #endif
  
! #include <stdlib.h>
! #include <string.h>
  #if _LIBC || HAVE_UNISTD_H
  # include <unistd.h>
  #endif
*** lib/unsetenv.c      14 Jul 2003 22:44:04 -0000      1.2
--- lib/unsetenv.c      10 Sep 2003 13:47:01 -0000
***************
*** 1,4 ****
! /* Copyright (C) 1992,1995-1999,2000-2002 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
--- 1,4 ----
! /* 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,38 ****
  # 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
  #if _LIBC || HAVE_UNISTD_H
  # include <unistd.h>
  #endif
--- 27,34 ----
  # define __set_errno(ev) ((errno) = (ev))
  #endif
  
! #include <stdlib.h>
! #include <string.h>
  #if _LIBC || HAVE_UNISTD_H
  # include <unistd.h>
  #endif
*** m4/setenv.m4        31 Dec 2002 13:43:06 -0000      1.2
--- m4/setenv.m4        10 Sep 2003 13:47:02 -0000
***************
*** 1,5 ****
! # setenv.m4 serial 3
! dnl Copyright (C) 2001-2002 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
--- 1,5 ----
! # 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,46 ****
  AC_DEFUN([gl_PREREQ_SETENV],
  [
    AC_REQUIRE([AC_FUNC_ALLOCA])
!   AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h)
    AC_CHECK_HEADERS(search.h)
    AC_CHECK_FUNCS(tsearch)
    gt_CHECK_VAR_DECL([#include <errno.h>], errno)
--- 40,46 ----
  AC_DEFUN([gl_PREREQ_SETENV],
  [
    AC_REQUIRE([AC_FUNC_ALLOCA])
!   AC_CHECK_HEADERS_ONCE(unistd.h)
    AC_CHECK_HEADERS(search.h)
    AC_CHECK_FUNCS(tsearch)
    gt_CHECK_VAR_DECL([#include <errno.h>], errno)
***************
*** 50,56 ****
  # Prerequisites of lib/unsetenv.c.
  AC_DEFUN([gl_PREREQ_UNSETENV],
  [
!   AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h)
    gt_CHECK_VAR_DECL([#include <errno.h>], errno)
    gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
  ])
--- 50,56 ----
  # Prerequisites of lib/unsetenv.c.
  AC_DEFUN([gl_PREREQ_UNSETENV],
  [
!   AC_CHECK_HEADERS_ONCE(unistd.h)
    gt_CHECK_VAR_DECL([#include <errno.h>], errno)
    gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
  ])





reply via email to

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