]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use a substitute for <unistd.h> on those platforms where it doesn't exist.
authorBruno Haible <bruno@clisp.org>
Mon, 24 Apr 2006 11:21:49 +0000 (11:21 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:12 +0000 (12:13 +0200)
28 files changed:
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/lib/ChangeLog
gettext-tools/lib/Makefile.am
gettext-tools/lib/addext.c
gettext-tools/lib/clean-temp.c
gettext-tools/lib/copy-file.c
gettext-tools/lib/execute.c
gettext-tools/lib/fatal-signal.c
gettext-tools/lib/findprog.c
gettext-tools/lib/getopt_.h
gettext-tools/lib/mkdtemp.c
gettext-tools/lib/pathmax.h
gettext-tools/lib/pipe.c
gettext-tools/lib/pipe.h
gettext-tools/lib/safe-read.c
gettext-tools/lib/unsetenv.c
gettext-tools/lib/wait-process.h
gettext-tools/lib/xgetcwd.c
gettext-tools/m4/ChangeLog
gettext-tools/m4/Makefile.am
gettext-tools/src/ChangeLog
gettext-tools/src/hostname.c
gettext-tools/src/msgexec.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/urlget.c

index 8b563b680b30b4d9990afab3d406fcfa81129c91..e849a392ead78f02a0ec4c3944b3e97d21ad171f 100644 (file)
@@ -1,3 +1,7 @@
+2006-04-23  Bruno Haible  <bruno@clisp.org>
+
+       * configure.ac: Invoke gl_HEADER_UNISTD.
+
 2006-04-17  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (gettextsrc_SCRIPTS): Remove mkinstalldirs.
index 82bb4b3b2563037f571522dc4598172d4cd1a945..562b40ad41939191213c7badad1fa54fa935375a 100644 (file)
@@ -136,6 +136,7 @@ dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(limits.h malloc.h pwd.h string.h unistd.h utime.h values.h)
 AM_STDBOOL_H
+gl_HEADER_UNISTD
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_INLINE
index b94c2a9501838de25d427bbde90222eb4149b5d7..acac96c4139156bc661fa4c39720e81e7ed622fb 100644 (file)
@@ -1,3 +1,24 @@
+2006-04-23  Bruno Haible  <bruno@clisp.org>
+
+       * addext.c: Include <unistd.h> unconditionally.
+       * clean-temp.c: Likewise.
+       * copy-file.c: Likewise.
+       * execute.c: Likewise.
+       * fatal-signal.c: Likewise.
+       * findprog.c: Likewise.
+       * getopt_.h: Likewise.
+       * mkdtemp.c: Likewise.
+       * pathmax.h: Likewise.
+       * pipe.h: Likewise.
+       * pipe.c: Likewise.
+       * safe-read.c: Likewise.
+       * unsetenv.c: Likewise.
+       * wait-process.h: Likewise.
+       * xgetcwd.c: Likewise.
+       * Makefile.am (BUILT_SOURCES): Conditionally add unistd.h.
+       (unistd.h): New rule.
+       (MOSTLYCLEANFILES): Add unistd.h.
+
 2006-04-17  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am: Use $(mkdir_p) instead of $(mkinstalldirs).
index 8f396195d39375e9879c488d522370f63fd8c581..17077b65baf770eefff8fe6de701bcce75f95822 100644 (file)
@@ -173,6 +173,17 @@ MOSTLYCLEANFILES += stdbool.h
 # <<< gnulib module stdbool.
 
 
+# >>> gnulib module unistd.
+BUILT_SOURCES += $(UNISTD_H)
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h:
+       echo '/* Empty placeholder for $@.  */' >$@
+MOSTLYCLEANFILES += unistd.h
+# <<< gnulib module unistd.
+
+
 # >>> gnulib module alloca.
 BUILT_SOURCES += $(ALLOCA_H)
 EXTRA_DIST += alloca_.h
index c6c2ac31f72258a03267dfe7c80bccadb7478c29..e81e5680a9d755ecaa440eaff6dd0fd3cbac3c63 100644 (file)
@@ -1,5 +1,5 @@
 /* addext.c -- add an extension to a file name
-   Copyright (C) 1990, 1997-1999, 2001-2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1997-1999, 2001-2003, 2005-2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -43,9 +43,7 @@
 # include <strings.h>
 #endif
 
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "basename.h"
 
index 9781f7bbc92cd12b93d4e6ebcfd711110bfd27cf..eb3ab413790e583b5d6fef92eebff9ea5b1bca05 100644 (file)
@@ -28,9 +28,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "error.h"
 #include "fatal-signal.h"
index 4b21eff8eb85ce73d86153fc7222a219e5e93ff5..b472be42267732c9aa74f5c4fd0a662fcaac9c90 100644 (file)
@@ -1,5 +1,5 @@
 /* Copying of files.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
 #include <fcntl.h>
 #include <stddef.h>
 #include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #if HAVE_UTIME || HAVE_UTIMES
 # if HAVE_UTIME_H
index ac9cb03edda89b9abaf5e5c23476db49a5fb2458..df6b1eaa842cbcc10a8e98ea7ac586fd670061ed 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of autonomous subprocesses.
-   Copyright (C) 2001-2004 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
 #include <stdbool.h>
 #include <stdlib.h>
 #include <signal.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "error.h"
 #include "exit.h"
index 5e245982ec2a4e073cb6bab15fc81ea31ed54285..97731043fb83687842e6d66a16f021f948de95d9 100644 (file)
@@ -27,9 +27,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <signal.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "xalloc.h"
 
index 150056f330d9e23bcc45a0b83540a9ebf768d4ca..5e9141ecd59fb7d994ce30ee5179c46037e71038 100644 (file)
@@ -1,5 +1,5 @@
 /* Locating a program in PATH.
-   Copyright (C) 2001-2004 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
 #include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "xalloc.h"
 #include "pathname.h"
index acc70fe6006649cd108e819886f105a068d82763..3a2d1040b95bfadd566d43bcf948c2e51fa2f2cf 100644 (file)
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994,1996-1999,2001,2003-2005
+   Copyright (C) 1989-1994,1996-1999,2001,2003-2006
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -42,9 +42,7 @@
 #if defined __GETOPT_PREFIX && !defined __need_getopt
 # include <stdlib.h>
 # include <stdio.h>
-# if HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
+# include <unistd.h>
 # undef __need_getopt
 # undef getopt
 # undef getopt_long
index 9571664252685de8425558aab98a94fe15f6a94f..4db16da34d2a7123aa0fbd2e5ef88efbe01a75ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001-2003, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,9 +46,7 @@
 # include <inttypes.h>
 #endif
 
-#if HAVE_UNISTD_H || _LIBC
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #if HAVE_GETTIMEOFDAY || _LIBC
 # if HAVE_SYS_TIME_H || _LIBC
index 48ba92a700ebd91060fff387d0715f27cc46eca2..6b77986ffb73c8174c61851d1ca893a8f56cb53a 100644 (file)
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1999, 2001, 2003, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -18,9 +18,7 @@
 #ifndef _PATHMAX_H
 # define _PATHMAX_H
 
-# if HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
+# include <unistd.h>
 
 /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
    PATH_MAX but might cause redefinition warnings when sys/param.h is
index 5ad293551cff962d5950359ecee621010961bd54..a0bf6796fa96aadc253991e0a93dcf75d7705c66 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of subprocesses, communicating via pipes.
-   Copyright (C) 2001-2004 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
 #include <fcntl.h>
 #include <stdlib.h>
 #include <signal.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "error.h"
 #include "exit.h"
index 5d7b473fe9ef15ed863f8b2c58ad1d2989f837c8..3856524740ae162065fdfb5182ac125264e9bb67 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of subprocesses, communicating via pipes.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,9 +21,7 @@
 
 /* Get pid_t.  */
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <sys/types.h>
 
 #include <stdbool.h>
index ac58a8ea9be63eceee5ca8fb022ed938fe8fdb1d..92ed49d3e20e60ec34bcfc1f45b87a5dbc0ef48f 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to read and write that retries after interrupts.
 
-   Copyright (C) 1993-1994, 1998, 2002-2005 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1998, 2002-2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,9 +29,7 @@
 
 /* Get ssize_t.  */
 #include <sys/types.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include <errno.h>
 
index 332dd38c4fe4390292d732ad7cda3d5014e18658..6e6aaae10c0d1b90ea61d2eb0ebf0682a13f6f54 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-1999,2000-2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2002,2005-2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,9 +30,7 @@ extern int errno;
 
 #include <stdlib.h>
 #include <string.h>
-#if _LIBC || HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #if !_LIBC
 # define __environ     environ
index 109760a2d0a08404875734b08ce34b1679758a0b..9cdce30478ad299ca682df8505d3e557e9686b73 100644 (file)
@@ -1,5 +1,5 @@
 /* Waiting for a subprocess to finish.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,9 +21,7 @@
 
 /* Get pid_t.  */
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <sys/types.h>
 
 #include <stdbool.h>
index 9d475e91b5f8c086ebee13870665498ade03577d..ecb51b725143e9154ef0f817a308df013348f6a7 100644 (file)
@@ -1,5 +1,5 @@
 /* xgetcwd.c -- return current directory with unlimited length
-   Copyright (C) 1992, 1996, 2000, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1996, 2000, 2003, 2005-2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,9 +29,7 @@ extern int errno;
 #endif
 
 #include <sys/types.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "pathmax.h"
 
index bdc827719bc958b49754a850b7a53bde5de6f3d4..fba5476f4721450a31b581b09b72b9219c66e5d0 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-23  Bruno Haible  <bruno@clisp.org>
+
+       * unistd_h.m4: New file, from gnulib.
+       * Makefile.am (EXTRA_DIST): Add it.
+
 2006-04-14  Bruno Haible  <bruno@clisp.org>
 
        Prepare for autoconf-2.60.
index 2505638fb01aa6381475c4486a46408063031639..9e455500aa6a4defea96298adbd4b80fb061e3ce 100644 (file)
@@ -100,5 +100,6 @@ strtol.m4 \
 strtoul.m4 \
 tmpdir.m4 \
 unionwait.m4 \
+unistd_h.m4 \
 unlocked-io.m4 \
 xreadlink.m4
index 2cb3e515dcfc6c60831ad2148de8254f2da61b70..39ac61b5419a151ae0be09211c59126d8324b3d7 100644 (file)
@@ -1,3 +1,12 @@
+2006-04-23  Bruno Haible  <bruno@clisp.org>
+
+       * msgexec.c: Include <unistd.h> unconditionally.
+       * msgfilter.c: Likewise.
+       * msggrep.c: Likewise.
+       * msginit.c: Likewise.
+       * hostname.c: Likewise.
+       * urlget.c: Likewise.
+
 2006-04-17  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am: Use $(mkdir_p) instead of $(mkinstalldirs).
index d6d497952fea49ea087fad9a32f34996c9167f7f..ae0e5251dbe005682b85b74b6f451a8951633878 100644 (file)
@@ -34,9 +34,7 @@
 #endif
 
 /* Get gethostname().  */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #ifdef WIN32
 /* Native Woe32 API lacks gethostname() but has GetComputerName() instead.  */
index 7f095069f043aa928909bb7739d2f0c2dc7af175..1e044b91cb61cab80ecba0c1e6d8fc48a0d0d234 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "closeout.h"
 #include "dir-list.h"
index a5531d1a7c22ab9a47478a8cd12a14e20e06bcdb..785caa2310fad3fd549a12c1d07022523329aa9e 100644 (file)
@@ -35,9 +35,8 @@
 # include <sys/time.h>
 #endif
 
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#elif defined _MSC_VER || defined __MINGW32__
+#include <unistd.h>
+#if defined _MSC_VER || defined __MINGW32__
 # include <io.h>
 #endif
 
index f9c340a6694ec2dc85ef9fbaf7983436ed7ac207..f9ca9657d291d541a5068c8608a728bfb0399125 100644 (file)
@@ -31,9 +31,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#elif defined _MSC_VER || defined __MINGW32__
+#include <unistd.h>
+#if defined _MSC_VER || defined __MINGW32__
 # include <io.h>
 #endif
 
index acd7d93138cbb724e8e760dd82ac5bcd78901c53..fac4d550fc6835932ec69333e2e1672351eeaf3e 100644 (file)
@@ -37,9 +37,7 @@
 # include <pwd.h>
 #endif
 
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #if HAVE_DIRENT_H
 # include <dirent.h>
index 1d4ced1746ec4b1108671f6580ebbe37b67edf4e..83da0c5203482e30df57a9f90cd2e96a675b0202 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <locale.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 
 #include "closeout.h"
 #include "error.h"