1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-25 19:11:56 +00:00

Include <unistd.h> unilaterally.

This commit is contained in:
Paul Eggert 2011-01-09 00:12:35 -08:00
parent 613f7bda1d
commit 4004364e67
42 changed files with 26 additions and 104 deletions

View File

@ -1,5 +1,11 @@
2011-01-09 Paul Eggert <eggert@cs.ucla.edu> 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". Include <getopt.h> not "getopt.h".
* ebrowse.c, emacsclient.c: 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 Since getopt.h is no longer in this directory, there's no point

View File

@ -75,9 +75,7 @@ char *w32_getenv (char *);
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
#ifdef HAVE_UNISTD_H #include <unistd.h>
# include <unistd.h>
#endif
#include <pwd.h> #include <pwd.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -172,9 +172,8 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
# endif # endif
#endif /* !WINDOWSNT */ #endif /* !WINDOWSNT */
#ifdef HAVE_UNISTD_H #include <unistd.h>
# include <unistd.h> #ifndef HAVE_UNISTD_H
#else
# if defined (HAVE_GETCWD) && !defined (WINDOWSNT) # if defined (HAVE_GETCWD) && !defined (WINDOWSNT)
extern char *getcwd (char *buf, size_t size); extern char *getcwd (char *buf, size_t size);
# endif # endif

View File

@ -62,9 +62,7 @@ main ()
#include <stdlib.h> #include <stdlib.h>
/* This is to declare cuserid. */ /* This is to declare cuserid. */
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
/* Type definitions */ /* Type definitions */

View File

@ -78,9 +78,7 @@ void fatal (const char *s1, const char *s2) NO_RETURN;
#undef chdir #undef chdir
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
/* Stdio stream for output to the DOC file. */ /* Stdio stream for output to the DOC file. */
FILE *outfile; FILE *outfile;

View File

@ -63,9 +63,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <time.h> #include <time.h>
#include <getopt.h> #include <getopt.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
#include <fcntl.h> #include <fcntl.h>
#endif #endif

View File

@ -68,9 +68,7 @@ extern struct servent *hes_getservbyname (/* char *, char * */);
#include <string.h> #include <string.h>
#define index strchr #define index strchr
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef KERBEROS #ifdef KERBEROS
# ifdef HAVE_KRB5_H # ifdef HAVE_KRB5_H

View File

@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
/* Break string in two parts to avoid buggy C compilers that ignore characters /* Break string in two parts to avoid buggy C compilers that ignore characters
after nulls in strings. */ after nulls in strings. */

View File

@ -34,9 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <errno.h> #include <errno.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
#include <string.h> #include <string.h>

View File

@ -1,5 +1,15 @@
2011-01-09 Paul Eggert <eggert@cs.ucla.edu> 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. * mktime.c: Remove; moving to ../lib.
Use gnulib's mktime module. Use gnulib's mktime module.

View File

@ -59,9 +59,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef GC_MALLOC_CHECK #undef GC_MALLOC_CHECK
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#else #ifndef HAVE_UNISTD_H
extern POINTER_TYPE *sbrk (); extern POINTER_TYPE *sbrk ();
#endif #endif

View File

@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h" #include "systime.h"
#include "blockinput.h" #include "blockinput.h"
#include "atimer.h" #include "atimer.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>

View File

@ -27,10 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"
#include "intervals.h" #include "intervals.h"

View File

@ -25,10 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <sys/file.h> #include <sys/file.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -31,10 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <grp.h> #include <grp.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
/* The d_nameln member of a struct dirent includes the '\0' character /* 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 on some systems, but not on others. What's worse, you can't tell

View File

@ -23,10 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"
#include "termchar.h" #include "termchar.h"

View File

@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <ctype.h> #include <ctype.h>
#include <setjmp.h> #include <setjmp.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"
#include "buffer.h" #include "buffer.h"

View File

@ -29,9 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <float.h> #include <float.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"

View File

@ -29,9 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <pwd.h> #include <pwd.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h> #include <sys/utsname.h>

View File

@ -28,10 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h> #include <sys/types.h>
#include <sys/file.h> #include <sys/file.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef WINDOWSNT #ifdef WINDOWSNT
#include <fcntl.h> #include <fcntl.h>

View File

@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#if !defined (S_ISLNK) && defined (S_IFLNK) #if !defined (S_ISLNK) && defined (S_IFLNK)
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)

View File

@ -32,10 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/file.h> #include <sys/file.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#include <sys/sysctl.h> #include <sys/sysctl.h>

View File

@ -21,9 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <time.h> #include <time.h>
#include <setjmp.h> #include <setjmp.h>

View File

@ -355,10 +355,7 @@ extern int errno;
# define LDAV_SYMBOL "avenrun" # define LDAV_SYMBOL "avenrun"
# endif # endif
# ifdef HAVE_UNISTD_H # include <unistd.h>
# include <unistd.h>
# endif
# include <stdio.h> # include <stdio.h>
/* LOAD_AVE_TYPE should only get defined if we're going to use the /* LOAD_AVE_TYPE should only get defined if we're going to use the

View File

@ -19,9 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef HAVE_GETPAGESIZE #ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H # include <unistd.h>
# include <unistd.h>
# endif
# ifdef _SC_PAGESIZE # ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE) # define getpagesize() sysconf(_SC_PAGESIZE)

View File

@ -72,9 +72,7 @@ Fifth Floor, Boston, MA 02110-1301, USA.
#define CHAR_BIT 8 #define CHAR_BIT 8
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef USE_PTHREAD #ifdef USE_PTHREAD
#include <pthread.h> #include <pthread.h>

View File

@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef HAVE_PNG #ifdef HAVE_PNG
#if defined HAVE_LIBPNG_PNG_H #if defined HAVE_LIBPNG_PNG_H

View File

@ -58,10 +58,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "syssignal.h" #include "syssignal.h"
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <fcntl.h> #include <fcntl.h>
/* This is to get the definitions of the XK_ symbols. */ /* This is to get the definitions of the XK_ symbols. */

View File

@ -45,10 +45,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "msdos.h" #include "msdos.h"
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <math.h> #include <math.h>
#ifdef HAVE_SETLOCALE #ifdef HAVE_SETLOCALE

View File

@ -32,9 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <inttypes.h> #include <inttypes.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <fcntl.h> #include <fcntl.h>
/* Only MS-DOS does not define `subprocesses'. */ /* Only MS-DOS does not define `subprocesses'. */

View File

@ -20,9 +20,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef HAVE_GNUTLS #ifdef HAVE_GNUTLS
#include "gnutls.h" #include "gnutls.h"

View File

@ -30,9 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h" /* Needed for VALBITS. */ #include "lisp.h" /* Needed for VALBITS. */
#include "blockinput.h" #include "blockinput.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
typedef POINTER_TYPE *POINTER; typedef POINTER_TYPE *POINTER;
typedef size_t SIZE; typedef size_t SIZE;

View File

@ -196,9 +196,7 @@
even if config.h says that we can. */ even if config.h says that we can. */
# undef REL_ALLOC # undef REL_ALLOC
# ifdef HAVE_UNISTD_H # include <unistd.h>
# include <unistd.h>
# endif
/* When used in Emacs's lib-src, we need xmalloc and xrealloc. */ /* When used in Emacs's lib-src, we need xmalloc and xrealloc. */

View File

@ -30,9 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> #include <limits.h>
#endif /* HAVE_LIMITS_H */ #endif /* HAVE_LIMITS_H */
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"
#include "sysselect.h" #include "sysselect.h"

View File

@ -37,9 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/pty.h> #include <sys/pty.h>
#endif /* AIX */ #endif /* AIX */
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
/* Special cases - inhibiting the use of certain features. */ /* Special cases - inhibiting the use of certain features. */

View File

@ -25,11 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <sys/file.h> #include <sys/file.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <signal.h> #include <signal.h>
#include <stdarg.h> #include <stdarg.h>
#include <setjmp.h> #include <setjmp.h>

View File

@ -22,9 +22,7 @@ Boston, MA 02110-1301, USA. */
#include <setjmp.h> #include <setjmp.h>
#include <sys/file.h> #include <sys/file.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"

View File

@ -24,10 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <math.h> #include <math.h>
#include <setjmp.h> #include <setjmp.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
/* This makes the fields of a Display accessible, in Xlib header files. */ /* This makes the fields of a Display accessible, in Xlib header files. */

View File

@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <errno.h> #include <errno.h>
#include <epaths.h> #include <epaths.h>

View File

@ -27,9 +27,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "lisp.h" #include "lisp.h"
#include "xterm.h" /* for all of the X includes */ #include "xterm.h" /* for all of the X includes */

View File

@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <sys/param.h> #include <sys/param.h>
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>

View File

@ -90,9 +90,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifdef USE_GTK #ifdef USE_GTK
#include "gtkutil.h" #include "gtkutil.h"