From 4004364e6777a1ed2c3e2c0fdf9fed871b186ac3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 9 Jan 2011 00:12:35 -0800 Subject: [PATCH] Include unilaterally. --- lib-src/ChangeLog | 6 ++++++ lib-src/emacsclient.c | 4 +--- lib-src/etags.c | 5 ++--- lib-src/fakemail.c | 2 -- lib-src/make-docfile.c | 2 -- lib-src/movemail.c | 2 -- lib-src/pop.c | 2 -- lib-src/test-distrib.c | 3 --- lib-src/update-game-score.c | 2 -- src/ChangeLog | 10 ++++++++++ src/alloc.c | 3 +-- src/atimer.c | 3 --- src/buffer.c | 3 --- src/callproc.c | 3 --- src/dired.c | 3 --- src/dispnew.c | 3 --- src/doc.c | 3 --- src/doprnt.c | 2 -- src/editfns.c | 2 -- src/emacs.c | 3 --- src/fileio.c | 3 --- src/filelock.c | 3 --- src/fns.c | 2 -- src/getloadavg.c | 5 +---- src/getpagesize.h | 4 +--- src/gmalloc.c | 2 -- src/image.c | 3 --- src/keyboard.c | 3 --- src/lread.c | 3 --- src/process.c | 2 -- src/process.h | 3 +-- src/ralloc.c | 2 -- src/regex.c | 4 +--- src/sysdep.c | 2 -- src/systty.h | 2 -- src/term.c | 4 ---- src/termcap.c | 2 -- src/xfns.c | 3 --- src/xrdb.c | 3 --- src/xselect.c | 3 +-- src/xsmfns.c | 3 --- src/xterm.c | 3 +-- 42 files changed, 26 insertions(+), 104 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index cdceff66db4..df9f176270b 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,11 @@ 2011-01-09 Paul Eggert + Include unilaterally. + * emacsclient.c, etags.c, fakemail.c, make-docfile.c, movemail.c: + * pop.c, test-distrib.c, update-game-score.c: + Include without worrying about HAVE_UNISTD_H, since + unistd.h is always present now, possibly supplied by gnulib. + Include not "getopt.h". * ebrowse.c, emacsclient.c: Include , not "getopt.h". Since getopt.h is no longer in this directory, there's no point diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 7bf19d11473..6e52b4dfeab 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -75,9 +75,7 @@ char *w32_getenv (char *); #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include #include diff --git a/lib-src/etags.c b/lib-src/etags.c index f06e714c041..2721415adc9 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -172,9 +172,8 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; # endif #endif /* !WINDOWSNT */ -#ifdef HAVE_UNISTD_H -# include -#else +#include +#ifndef HAVE_UNISTD_H # if defined (HAVE_GETCWD) && !defined (WINDOWSNT) extern char *getcwd (char *buf, size_t size); # endif diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 16baeb266a8..b7ebe88cc5d 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -62,9 +62,7 @@ main () #include /* This is to declare cuserid. */ -#ifdef HAVE_UNISTD_H #include -#endif /* Type definitions */ diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index e2dc99214d2..43648c8abc7 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -78,9 +78,7 @@ void fatal (const char *s1, const char *s2) NO_RETURN; #undef chdir #endif -#ifdef HAVE_UNISTD_H #include -#endif /* Stdio stream for output to the DOC file. */ FILE *outfile; diff --git a/lib-src/movemail.c b/lib-src/movemail.c index f300942427e..8c6a0ddcb64 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -63,9 +63,7 @@ along with GNU Emacs. If not, see . */ #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_FCNTL_H #include #endif diff --git a/lib-src/pop.c b/lib-src/pop.c index 9eabbd2041e..78793f1e9c7 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -68,9 +68,7 @@ extern struct servent *hes_getservbyname (/* char *, char * */); #include #define index strchr #endif -#ifdef HAVE_UNISTD_H #include -#endif #ifdef KERBEROS # ifdef HAVE_KRB5_H diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c index aca46f121fa..bdb5b160491 100644 --- a/lib-src/test-distrib.c +++ b/lib-src/test-distrib.c @@ -22,10 +22,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif /* Break string in two parts to avoid buggy C compilers that ignore characters after nulls in strings. */ diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index b8e1147d1c1..ee4b9a3ba99 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -34,9 +34,7 @@ along with GNU Emacs. If not, see . */ #include -#ifdef HAVE_UNISTD_H #include -#endif #include #ifdef HAVE_STRING_H #include diff --git a/src/ChangeLog b/src/ChangeLog index badd1955c50..7374c4d878d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,15 @@ 2011-01-09 Paul Eggert + Include unilaterally. + * alloc.c, atimer.c, buffer.c, callproc.c, dired.c, dispnew.c, doc.c: + * doprnt.c, editfns.c, emacs.c, fileio.c, filelock.c, fns.c: + * getloadavg.c, getpagesize.h, gmalloc.c, image.c, keyboard.c: + * lread.c, process.c, process.h, ralloc.c, regex.c, sysdep.c: + * systty.h, term.c, termcap.c, xfns.c, xrdb.c, xselect.c, xsmfns.c: + * xterm.c: + Include without worrying about HAVE_UNISTD_H, since + unistd.h is always present now, possibly supplied by gnulib. + * mktime.c: Remove; moving to ../lib. Use gnulib's mktime module. diff --git a/src/alloc.c b/src/alloc.c index 089a7766ca4..9a249e679b7 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -59,9 +59,8 @@ along with GNU Emacs. If not, see . */ #undef GC_MALLOC_CHECK #endif -#ifdef HAVE_UNISTD_H #include -#else +#ifndef HAVE_UNISTD_H extern POINTER_TYPE *sbrk (); #endif diff --git a/src/atimer.c b/src/atimer.c index 6258908e0b2..56625edd9f4 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -26,10 +26,7 @@ along with GNU Emacs. If not, see . */ #include "systime.h" #include "blockinput.h" #include "atimer.h" - -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_SYS_TIME_H #include diff --git a/src/buffer.c b/src/buffer.c index 9766c60da9e..d85475b7155 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -27,10 +27,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #include "lisp.h" #include "intervals.h" diff --git a/src/callproc.c b/src/callproc.c index 59067040fd9..50025410354 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -25,10 +25,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/src/dired.c b/src/dired.c index d72ea54a518..7f3b59896e7 100644 --- a/src/dired.c +++ b/src/dired.c @@ -31,10 +31,7 @@ along with GNU Emacs. If not, see . */ #include #include - -#ifdef HAVE_UNISTD_H #include -#endif /* The d_nameln member of a struct dirent includes the '\0' character on some systems, but not on others. What's worse, you can't tell diff --git a/src/dispnew.c b/src/dispnew.c index 254ee7a2404..ae13cfc210c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -23,10 +23,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #include "lisp.h" #include "termchar.h" diff --git a/src/doc.c b/src/doc.c index 7caa88a7b5e..e57fb4d12b2 100644 --- a/src/doc.c +++ b/src/doc.c @@ -26,10 +26,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #include "lisp.h" #include "buffer.h" diff --git a/src/doprnt.c b/src/doprnt.c index 02adc51f1e5..8bfa1c7e11b 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -29,9 +29,7 @@ along with GNU Emacs. If not, see . */ #include #endif -#ifdef HAVE_UNISTD_H #include -#endif #include "lisp.h" diff --git a/src/editfns.c b/src/editfns.c index 4a9e2314a84..19eaf7ca022 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -29,9 +29,7 @@ along with GNU Emacs. If not, see . */ #include #endif -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_SYS_UTSNAME_H #include diff --git a/src/emacs.c b/src/emacs.c index 6a04eda9aa2..dca7245f986 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -28,10 +28,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #ifdef WINDOWSNT #include diff --git a/src/fileio.c b/src/fileio.c index 881dc92acab..26139393784 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -26,10 +26,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #if !defined (S_ISLNK) && defined (S_IFLNK) # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) diff --git a/src/filelock.c b/src/filelock.c index ae0584c447a..9eb1f461cd6 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -32,10 +32,7 @@ along with GNU Emacs. If not, see . */ #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #ifdef __FreeBSD__ #include diff --git a/src/fns.c b/src/fns.c index ddc193d85e4..8fd5c7d291a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -21,9 +21,7 @@ along with GNU Emacs. If not, see . */ #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include diff --git a/src/getloadavg.c b/src/getloadavg.c index 779a0ef804c..3b25e691166 100644 --- a/src/getloadavg.c +++ b/src/getloadavg.c @@ -355,10 +355,7 @@ extern int errno; # define LDAV_SYMBOL "avenrun" # endif -# ifdef HAVE_UNISTD_H -# include -# endif - +# include # include /* LOAD_AVE_TYPE should only get defined if we're going to use the diff --git a/src/getpagesize.h b/src/getpagesize.h index 2ec51ab3719..b69f0123ddf 100644 --- a/src/getpagesize.h +++ b/src/getpagesize.h @@ -19,9 +19,7 @@ along with GNU Emacs. If not, see . */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif +# include # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) diff --git a/src/gmalloc.c b/src/gmalloc.c index 8314798b171..7a5e95c7435 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -72,9 +72,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. #define CHAR_BIT 8 #endif -#ifdef HAVE_UNISTD_H #include -#endif #ifdef USE_PTHREAD #include diff --git a/src/image.c b/src/image.c index fd1b921056c..bff56b5f961 100644 --- a/src/image.c +++ b/src/image.c @@ -22,10 +22,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_PNG #if defined HAVE_LIBPNG_PNG_H diff --git a/src/keyboard.c b/src/keyboard.c index 7759549fa23..a39b128d014 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -58,10 +58,7 @@ along with GNU Emacs. If not, see . */ #include "syssignal.h" #include -#ifdef HAVE_UNISTD_H #include -#endif - #include /* This is to get the definitions of the XK_ symbols. */ diff --git a/src/lread.c b/src/lread.c index bc371fc02b0..4c73cc36dcf 100644 --- a/src/lread.c +++ b/src/lread.c @@ -45,10 +45,7 @@ along with GNU Emacs. If not, see . */ #include "msdos.h" #endif -#ifdef HAVE_UNISTD_H #include -#endif - #include #ifdef HAVE_SETLOCALE diff --git a/src/process.c b/src/process.c index 6ffcc5b8099..8f9d935e08f 100644 --- a/src/process.c +++ b/src/process.c @@ -32,9 +32,7 @@ along with GNU Emacs. If not, see . */ #include #endif -#ifdef HAVE_UNISTD_H #include -#endif #include /* Only MS-DOS does not define `subprocesses'. */ diff --git a/src/process.h b/src/process.h index 0350e95310d..908304f06e7 100644 --- a/src/process.h +++ b/src/process.h @@ -20,9 +20,8 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_UNISTD_H + #include -#endif #ifdef HAVE_GNUTLS #include "gnutls.h" diff --git a/src/ralloc.c b/src/ralloc.c index 5f2b52fcc4b..9b5e3bba582 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -30,9 +30,7 @@ along with GNU Emacs. If not, see . */ #include "lisp.h" /* Needed for VALBITS. */ #include "blockinput.h" -#ifdef HAVE_UNISTD_H #include -#endif typedef POINTER_TYPE *POINTER; typedef size_t SIZE; diff --git a/src/regex.c b/src/regex.c index 31f188efa99..4c54a2f863b 100644 --- a/src/regex.c +++ b/src/regex.c @@ -196,9 +196,7 @@ even if config.h says that we can. */ # undef REL_ALLOC -# ifdef HAVE_UNISTD_H -# include -# endif +# include /* When used in Emacs's lib-src, we need xmalloc and xrealloc. */ diff --git a/src/sysdep.c b/src/sysdep.c index ac766058d34..95efd505979 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -30,9 +30,7 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_LIMITS_H #include #endif /* HAVE_LIMITS_H */ -#ifdef HAVE_UNISTD_H #include -#endif #include "lisp.h" #include "sysselect.h" diff --git a/src/systty.h b/src/systty.h index 59850e7c321..ec858181011 100644 --- a/src/systty.h +++ b/src/systty.h @@ -37,9 +37,7 @@ along with GNU Emacs. If not, see . */ #include #endif /* AIX */ -#ifdef HAVE_UNISTD_H #include -#endif /* Special cases - inhibiting the use of certain features. */ diff --git a/src/term.c b/src/term.c index a684edc5a85..7027ba6b75b 100644 --- a/src/term.c +++ b/src/term.c @@ -25,11 +25,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif - #include #include #include diff --git a/src/termcap.c b/src/termcap.c index 4ad0cee6264..39ad08a66d3 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -22,9 +22,7 @@ Boston, MA 02110-1301, USA. */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include "lisp.h" diff --git a/src/xfns.c b/src/xfns.c index 32e390e1e1e..0ca5fdfe8c0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -24,10 +24,7 @@ along with GNU Emacs. If not, see . */ #include #include #include - -#ifdef HAVE_UNISTD_H #include -#endif /* This makes the fields of a Display accessible, in Xlib header files. */ diff --git a/src/xrdb.c b/src/xrdb.c index 8356ab8a45c..d8e2dfb2c6a 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -22,10 +22,7 @@ along with GNU Emacs. If not, see . */ #include -#ifdef HAVE_UNISTD_H #include -#endif - #include #include diff --git a/src/xselect.c b/src/xselect.c index 7b91d6f69b9..ed064584cc5 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -27,9 +27,8 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_UNISTD_H + #include -#endif #include "lisp.h" #include "xterm.h" /* for all of the X includes */ diff --git a/src/xsmfns.c b/src/xsmfns.c index 561fd5ee51a..cea7c0247d1 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -26,10 +26,7 @@ along with GNU Emacs. If not, see . */ #include #include -#ifdef HAVE_UNISTD_H #include -#endif - #include #include #include diff --git a/src/xterm.c b/src/xterm.c index f0ef8746b01..8168eb92bec 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -90,9 +90,8 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_UNISTD_H + #include -#endif #ifdef USE_GTK #include "gtkutil.h" -- 2.11.4.GIT