From: Bruno Haible Date: Mon, 24 Apr 2006 11:21:49 +0000 (+0000) Subject: Use a substitute for on those platforms where it doesn't exist. X-Git-Tag: v0.15~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38aec7e9a30e3869f154046664a20f2e1d0c8cb7;p=thirdparty%2Fgettext.git Use a substitute for on those platforms where it doesn't exist. --- diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index 8b563b680..e849a392e 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,7 @@ +2006-04-23 Bruno Haible + + * configure.ac: Invoke gl_HEADER_UNISTD. + 2006-04-17 Bruno Haible * Makefile.am (gettextsrc_SCRIPTS): Remove mkinstalldirs. diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 82bb4b3b2..562b40ad4 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -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 diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index b94c2a950..acac96c41 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,24 @@ +2006-04-23 Bruno Haible + + * addext.c: Include 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 * Makefile.am: Use $(mkdir_p) instead of $(mkinstalldirs). diff --git a/gettext-tools/lib/Makefile.am b/gettext-tools/lib/Makefile.am index 8f396195d..17077b65b 100644 --- a/gettext-tools/lib/Makefile.am +++ b/gettext-tools/lib/Makefile.am @@ -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 +# 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 diff --git a/gettext-tools/lib/addext.c b/gettext-tools/lib/addext.c index c6c2ac31f..e81e5680a 100644 --- a/gettext-tools/lib/addext.c +++ b/gettext-tools/lib/addext.c @@ -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 #endif -#if HAVE_UNISTD_H -# include -#endif +#include #include "basename.h" diff --git a/gettext-tools/lib/clean-temp.c b/gettext-tools/lib/clean-temp.c index 9781f7bbc..eb3ab4137 100644 --- a/gettext-tools/lib/clean-temp.c +++ b/gettext-tools/lib/clean-temp.c @@ -28,9 +28,7 @@ #include #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "error.h" #include "fatal-signal.h" diff --git a/gettext-tools/lib/copy-file.c b/gettext-tools/lib/copy-file.c index 4b21eff8e..b472be422 100644 --- a/gettext-tools/lib/copy-file.c +++ b/gettext-tools/lib/copy-file.c @@ -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 , 2001. This program is free software; you can redistribute it and/or modify @@ -28,10 +28,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #if HAVE_UTIME || HAVE_UTIMES # if HAVE_UTIME_H diff --git a/gettext-tools/lib/execute.c b/gettext-tools/lib/execute.c index ac9cb03ed..df6b1eaa8 100644 --- a/gettext-tools/lib/execute.c +++ b/gettext-tools/lib/execute.c @@ -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 , 2001. This program is free software; you can redistribute it and/or modify @@ -29,10 +29,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "error.h" #include "exit.h" diff --git a/gettext-tools/lib/fatal-signal.c b/gettext-tools/lib/fatal-signal.c index 5e245982e..97731043f 100644 --- a/gettext-tools/lib/fatal-signal.c +++ b/gettext-tools/lib/fatal-signal.c @@ -27,9 +27,7 @@ #include #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "xalloc.h" diff --git a/gettext-tools/lib/findprog.c b/gettext-tools/lib/findprog.c index 150056f33..5e9141ecd 100644 --- a/gettext-tools/lib/findprog.c +++ b/gettext-tools/lib/findprog.c @@ -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 , 2001. This program is free software; you can redistribute it and/or modify @@ -27,10 +27,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "xalloc.h" #include "pathname.h" diff --git a/gettext-tools/lib/getopt_.h b/gettext-tools/lib/getopt_.h index acc70fe60..3a2d1040b 100644 --- a/gettext-tools/lib/getopt_.h +++ b/gettext-tools/lib/getopt_.h @@ -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 # include -# if HAVE_UNISTD_H -# include -# endif +# include # undef __need_getopt # undef getopt # undef getopt_long diff --git a/gettext-tools/lib/mkdtemp.c b/gettext-tools/lib/mkdtemp.c index 957166425..4db16da34 100644 --- a/gettext-tools/lib/mkdtemp.c +++ b/gettext-tools/lib/mkdtemp.c @@ -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 #endif -#if HAVE_UNISTD_H || _LIBC -# include -#endif +#include #if HAVE_GETTIMEOFDAY || _LIBC # if HAVE_SYS_TIME_H || _LIBC diff --git a/gettext-tools/lib/pathmax.h b/gettext-tools/lib/pathmax.h index 48ba92a70..6b77986ff 100644 --- a/gettext-tools/lib/pathmax.h +++ b/gettext-tools/lib/pathmax.h @@ -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 -# endif +# include /* 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 diff --git a/gettext-tools/lib/pipe.c b/gettext-tools/lib/pipe.c index 5ad293551..a0bf6796f 100644 --- a/gettext-tools/lib/pipe.c +++ b/gettext-tools/lib/pipe.c @@ -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 , 2001. This program is free software; you can redistribute it and/or modify @@ -28,10 +28,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "error.h" #include "exit.h" diff --git a/gettext-tools/lib/pipe.h b/gettext-tools/lib/pipe.h index 5d7b473fe..385652474 100644 --- a/gettext-tools/lib/pipe.h +++ b/gettext-tools/lib/pipe.h @@ -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 , 2001. This program is free software; you can redistribute it and/or modify @@ -21,9 +21,7 @@ /* Get pid_t. */ #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/gettext-tools/lib/safe-read.c b/gettext-tools/lib/safe-read.c index ac58a8ea9..92ed49d3e 100644 --- a/gettext-tools/lib/safe-read.c +++ b/gettext-tools/lib/safe-read.c @@ -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 -#if HAVE_UNISTD_H -# include -#endif +#include #include diff --git a/gettext-tools/lib/unsetenv.c b/gettext-tools/lib/unsetenv.c index 332dd38c4..6e6aaae10 100644 --- a/gettext-tools/lib/unsetenv.c +++ b/gettext-tools/lib/unsetenv.c @@ -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 #include -#if _LIBC || HAVE_UNISTD_H -# include -#endif +#include #if !_LIBC # define __environ environ diff --git a/gettext-tools/lib/wait-process.h b/gettext-tools/lib/wait-process.h index 109760a2d..9cdce3047 100644 --- a/gettext-tools/lib/wait-process.h +++ b/gettext-tools/lib/wait-process.h @@ -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 , 2001. This program is free software; you can redistribute it and/or modify @@ -21,9 +21,7 @@ /* Get pid_t. */ #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/gettext-tools/lib/xgetcwd.c b/gettext-tools/lib/xgetcwd.c index 9d475e91b..ecb51b725 100644 --- a/gettext-tools/lib/xgetcwd.c +++ b/gettext-tools/lib/xgetcwd.c @@ -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 -#if HAVE_UNISTD_H -# include -#endif +#include #include "pathmax.h" diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog index bdc827719..fba5476f4 100644 --- a/gettext-tools/m4/ChangeLog +++ b/gettext-tools/m4/ChangeLog @@ -1,3 +1,8 @@ +2006-04-23 Bruno Haible + + * unistd_h.m4: New file, from gnulib. + * Makefile.am (EXTRA_DIST): Add it. + 2006-04-14 Bruno Haible Prepare for autoconf-2.60. diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am index 2505638fb..9e455500a 100644 --- a/gettext-tools/m4/Makefile.am +++ b/gettext-tools/m4/Makefile.am @@ -100,5 +100,6 @@ strtol.m4 \ strtoul.m4 \ tmpdir.m4 \ unionwait.m4 \ +unistd_h.m4 \ unlocked-io.m4 \ xreadlink.m4 diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 2cb3e515d..39ac61b54 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,12 @@ +2006-04-23 Bruno Haible + + * msgexec.c: Include unconditionally. + * msgfilter.c: Likewise. + * msggrep.c: Likewise. + * msginit.c: Likewise. + * hostname.c: Likewise. + * urlget.c: Likewise. + 2006-04-17 Bruno Haible * Makefile.am: Use $(mkdir_p) instead of $(mkinstalldirs). diff --git a/gettext-tools/src/hostname.c b/gettext-tools/src/hostname.c index d6d497952..ae0e5251d 100644 --- a/gettext-tools/src/hostname.c +++ b/gettext-tools/src/hostname.c @@ -34,9 +34,7 @@ #endif /* Get gethostname(). */ -#if HAVE_UNISTD_H -# include -#endif +#include #ifdef WIN32 /* Native Woe32 API lacks gethostname() but has GetComputerName() instead. */ diff --git a/gettext-tools/src/msgexec.c b/gettext-tools/src/msgexec.c index 7f095069f..1e044b91c 100644 --- a/gettext-tools/src/msgexec.c +++ b/gettext-tools/src/msgexec.c @@ -29,10 +29,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "closeout.h" #include "dir-list.h" diff --git a/gettext-tools/src/msgfilter.c b/gettext-tools/src/msgfilter.c index a5531d1a7..785caa231 100644 --- a/gettext-tools/src/msgfilter.c +++ b/gettext-tools/src/msgfilter.c @@ -35,9 +35,8 @@ # include #endif -#ifdef HAVE_UNISTD_H -# include -#elif defined _MSC_VER || defined __MINGW32__ +#include +#if defined _MSC_VER || defined __MINGW32__ # include #endif diff --git a/gettext-tools/src/msggrep.c b/gettext-tools/src/msggrep.c index f9c340a66..f9ca9657d 100644 --- a/gettext-tools/src/msggrep.c +++ b/gettext-tools/src/msggrep.c @@ -31,9 +31,8 @@ #include #include -#ifdef HAVE_UNISTD_H -# include -#elif defined _MSC_VER || defined __MINGW32__ +#include +#if defined _MSC_VER || defined __MINGW32__ # include #endif diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index acd7d9313..fac4d550f 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -37,9 +37,7 @@ # include #endif -#if HAVE_UNISTD_H -# include -#endif +#include #if HAVE_DIRENT_H # include diff --git a/gettext-tools/src/urlget.c b/gettext-tools/src/urlget.c index 1d4ced174..83da0c520 100644 --- a/gettext-tools/src/urlget.c +++ b/gettext-tools/src/urlget.c @@ -28,10 +28,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "closeout.h" #include "error.h"