Mercurial > emacs
changeset 112317:7df2e30d72ec
Include <unistd.h> unilaterally.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sun, 09 Jan 2011 00:12:35 -0800 |
parents | 2887524f362a |
children | deae5bb3f0f6 |
files | lib-src/ChangeLog lib-src/emacsclient.c lib-src/etags.c lib-src/fakemail.c lib-src/make-docfile.c lib-src/movemail.c lib-src/pop.c lib-src/test-distrib.c lib-src/update-game-score.c src/ChangeLog src/alloc.c src/atimer.c src/buffer.c src/callproc.c src/dired.c src/dispnew.c src/doc.c src/doprnt.c src/editfns.c src/emacs.c src/fileio.c src/filelock.c src/fns.c src/getloadavg.c src/getpagesize.h src/gmalloc.c src/image.c src/keyboard.c src/lread.c src/process.c src/process.h src/ralloc.c src/regex.c src/sysdep.c src/systty.h src/term.c src/termcap.c src/xfns.c src/xrdb.c src/xselect.c src/xsmfns.c src/xterm.c |
diffstat | 42 files changed, 26 insertions(+), 104 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/ChangeLog Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/ChangeLog Sun Jan 09 00:12:35 2011 -0800 @@ -1,5 +1,11 @@ 2011-01-09 Paul Eggert <eggert@cs.ucla.edu> + Include <unistd.h> unilaterally. + * emacsclient.c, etags.c, fakemail.c, make-docfile.c, movemail.c: + * pop.c, test-distrib.c, update-game-score.c: + Include <unistd.h> without worrying about HAVE_UNISTD_H, since + unistd.h is always present now, possibly supplied by gnulib. + Include <getopt.h> not "getopt.h". * ebrowse.c, emacsclient.c: Include <getopt.h>, not "getopt.h". Since getopt.h is no longer in this directory, there's no point
--- a/lib-src/emacsclient.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/emacsclient.c Sun Jan 09 00:12:35 2011 -0800 @@ -75,9 +75,7 @@ #include <ctype.h> #include <stdio.h> #include <getopt.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <pwd.h> #include <sys/stat.h>
--- a/lib-src/etags.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/etags.c Sun Jan 09 00:12:35 2011 -0800 @@ -172,9 +172,8 @@ # endif #endif /* !WINDOWSNT */ -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#else +#include <unistd.h> +#ifndef HAVE_UNISTD_H # if defined (HAVE_GETCWD) && !defined (WINDOWSNT) extern char *getcwd (char *buf, size_t size); # endif
--- a/lib-src/fakemail.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/fakemail.c Sun Jan 09 00:12:35 2011 -0800 @@ -62,9 +62,7 @@ #include <stdlib.h> /* This is to declare cuserid. */ -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif /* Type definitions */
--- a/lib-src/make-docfile.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/make-docfile.c Sun Jan 09 00:12:35 2011 -0800 @@ -78,9 +78,7 @@ #undef chdir #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif /* Stdio stream for output to the DOC file. */ FILE *outfile;
--- a/lib-src/movemail.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/movemail.c Sun Jan 09 00:12:35 2011 -0800 @@ -63,9 +63,7 @@ #include <time.h> #include <getopt.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif
--- a/lib-src/pop.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/pop.c Sun Jan 09 00:12:35 2011 -0800 @@ -68,9 +68,7 @@ #include <string.h> #define index strchr #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef KERBEROS # ifdef HAVE_KRB5_H
--- a/lib-src/test-distrib.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/test-distrib.c Sun Jan 09 00:12:35 2011 -0800 @@ -22,10 +22,7 @@ #include <config.h> #include <stdio.h> #include <fcntl.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif /* Break string in two parts to avoid buggy C compilers that ignore characters after nulls in strings. */
--- a/lib-src/update-game-score.c Sun Jan 09 00:00:02 2011 -0800 +++ b/lib-src/update-game-score.c Sun Jan 09 00:12:35 2011 -0800 @@ -34,9 +34,7 @@ #include <config.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include <errno.h> #ifdef HAVE_STRING_H #include <string.h>
--- a/src/ChangeLog Sun Jan 09 00:00:02 2011 -0800 +++ b/src/ChangeLog Sun Jan 09 00:12:35 2011 -0800 @@ -1,5 +1,15 @@ 2011-01-09 Paul Eggert <eggert@cs.ucla.edu> + Include <unistd.h> 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 <unistd.h> 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.
--- a/src/alloc.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/alloc.c Sun Jan 09 00:12:35 2011 -0800 @@ -59,9 +59,8 @@ #undef GC_MALLOC_CHECK #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#else +#ifndef HAVE_UNISTD_H extern POINTER_TYPE *sbrk (); #endif
--- a/src/atimer.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/atimer.c Sun Jan 09 00:12:35 2011 -0800 @@ -26,10 +26,7 @@ #include "systime.h" #include "blockinput.h" #include "atimer.h" - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef HAVE_SYS_TIME_H #include <sys/time.h>
--- a/src/buffer.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/buffer.c Sun Jan 09 00:12:35 2011 -0800 @@ -27,10 +27,7 @@ #include <errno.h> #include <stdio.h> #include <setjmp.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "lisp.h" #include "intervals.h"
--- a/src/callproc.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/callproc.c Sun Jan 09 00:12:35 2011 -0800 @@ -25,10 +25,7 @@ #include <stdio.h> #include <setjmp.h> #include <sys/types.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include <sys/file.h> #include <fcntl.h>
--- a/src/dired.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/dired.c Sun Jan 09 00:12:35 2011 -0800 @@ -31,10 +31,7 @@ #include <grp.h> #include <errno.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#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
--- a/src/dispnew.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/dispnew.c Sun Jan 09 00:12:35 2011 -0800 @@ -23,10 +23,7 @@ #include <stdio.h> #include <ctype.h> #include <setjmp.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "lisp.h" #include "termchar.h"
--- a/src/doc.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/doc.c Sun Jan 09 00:12:35 2011 -0800 @@ -26,10 +26,7 @@ #include <ctype.h> #include <setjmp.h> #include <fcntl.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "lisp.h" #include "buffer.h"
--- a/src/doprnt.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/doprnt.c Sun Jan 09 00:12:35 2011 -0800 @@ -29,9 +29,7 @@ #include <float.h> #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "lisp.h"
--- a/src/editfns.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/editfns.c Sun Jan 09 00:12:35 2011 -0800 @@ -29,9 +29,7 @@ #include <pwd.h> #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef HAVE_SYS_UTSNAME_H #include <sys/utsname.h>
--- a/src/emacs.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/emacs.c Sun Jan 09 00:12:35 2011 -0800 @@ -28,10 +28,7 @@ #include <sys/types.h> #include <sys/file.h> #include <setjmp.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef WINDOWSNT #include <fcntl.h>
--- a/src/fileio.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/fileio.c Sun Jan 09 00:12:35 2011 -0800 @@ -26,10 +26,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <setjmp.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #if !defined (S_ISLNK) && defined (S_IFLNK) # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
--- a/src/filelock.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/filelock.c Sun Jan 09 00:12:35 2011 -0800 @@ -32,10 +32,7 @@ #include <sys/file.h> #include <fcntl.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef __FreeBSD__ #include <sys/sysctl.h>
--- a/src/fns.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/fns.c Sun Jan 09 00:12:35 2011 -0800 @@ -21,9 +21,7 @@ #include <config.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include <time.h> #include <setjmp.h>
--- a/src/getloadavg.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/getloadavg.c Sun Jan 09 00:12:35 2011 -0800 @@ -355,10 +355,7 @@ # define LDAV_SYMBOL "avenrun" # endif -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif - +# include <unistd.h> # include <stdio.h> /* LOAD_AVE_TYPE should only get defined if we're going to use the
--- a/src/getpagesize.h Sun Jan 09 00:00:02 2011 -0800 +++ b/src/getpagesize.h Sun Jan 09 00:12:35 2011 -0800 @@ -19,9 +19,7 @@ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif +# include <unistd.h> # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE)
--- a/src/gmalloc.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/gmalloc.c Sun Jan 09 00:12:35 2011 -0800 @@ -72,9 +72,7 @@ #define CHAR_BIT 8 #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef USE_PTHREAD #include <pthread.h>
--- a/src/image.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/image.c Sun Jan 09 00:12:35 2011 -0800 @@ -22,10 +22,7 @@ #include <stdio.h> #include <math.h> #include <ctype.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #ifdef HAVE_PNG #if defined HAVE_LIBPNG_PNG_H
--- a/src/keyboard.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/keyboard.c Sun Jan 09 00:12:35 2011 -0800 @@ -58,10 +58,7 @@ #include "syssignal.h" #include <sys/types.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif - #include <fcntl.h> /* This is to get the definitions of the XK_ symbols. */
--- a/src/lread.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/lread.c Sun Jan 09 00:12:35 2011 -0800 @@ -45,10 +45,7 @@ #include "msdos.h" #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif - #include <math.h> #ifdef HAVE_SETLOCALE
--- a/src/process.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/process.c Sun Jan 09 00:12:35 2011 -0800 @@ -32,9 +32,7 @@ #include <inttypes.h> #endif -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include <fcntl.h> /* Only MS-DOS does not define `subprocesses'. */
--- a/src/process.h Sun Jan 09 00:00:02 2011 -0800 +++ b/src/process.h Sun Jan 09 00:12:35 2011 -0800 @@ -20,9 +20,8 @@ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif #ifdef HAVE_GNUTLS #include "gnutls.h"
--- a/src/ralloc.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/ralloc.c Sun Jan 09 00:12:35 2011 -0800 @@ -30,9 +30,7 @@ #include "lisp.h" /* Needed for VALBITS. */ #include "blockinput.h" -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif typedef POINTER_TYPE *POINTER; typedef size_t SIZE;
--- a/src/regex.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/regex.c Sun Jan 09 00:12:35 2011 -0800 @@ -196,9 +196,7 @@ even if config.h says that we can. */ # undef REL_ALLOC -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif +# include <unistd.h> /* When used in Emacs's lib-src, we need xmalloc and xrealloc. */
--- a/src/sysdep.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/sysdep.c Sun Jan 09 00:12:35 2011 -0800 @@ -30,9 +30,7 @@ #ifdef HAVE_LIMITS_H #include <limits.h> #endif /* HAVE_LIMITS_H */ -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "lisp.h" #include "sysselect.h"
--- a/src/systty.h Sun Jan 09 00:00:02 2011 -0800 +++ b/src/systty.h Sun Jan 09 00:12:35 2011 -0800 @@ -37,9 +37,7 @@ #include <sys/pty.h> #endif /* AIX */ -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif /* Special cases - inhibiting the use of certain features. */
--- a/src/term.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/term.c Sun Jan 09 00:12:35 2011 -0800 @@ -25,11 +25,7 @@ #include <ctype.h> #include <errno.h> #include <sys/file.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif - #include <signal.h> #include <stdarg.h> #include <setjmp.h>
--- a/src/termcap.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/termcap.c Sun Jan 09 00:12:35 2011 -0800 @@ -22,9 +22,7 @@ #include <setjmp.h> #include <sys/file.h> #include <fcntl.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "lisp.h"
--- a/src/xfns.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/xfns.c Sun Jan 09 00:12:35 2011 -0800 @@ -24,10 +24,7 @@ #include <math.h> #include <setjmp.h> #include <ctype.h> - -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif /* This makes the fields of a Display accessible, in Xlib header files. */
--- a/src/xrdb.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/xrdb.c Sun Jan 09 00:12:35 2011 -0800 @@ -22,10 +22,7 @@ #include <config.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif - #include <errno.h> #include <epaths.h>
--- a/src/xselect.c Sun Jan 09 00:00:02 2011 -0800 +++ b/src/xselect.c Sun Jan 09 00:12:35 2011 -0800 @@ -27,9 +27,8 @@ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif #include "lisp.h" #include "xterm.h" /* for all of the X includes */