aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2011-01-09 00:12:35 -0800
committerPaul Eggert <[email protected]>2011-01-09 00:12:35 -0800
commit4004364e6777a1ed2c3e2c0fdf9fed871b186ac3 (patch)
tree44d96204ce5ebd144662234e6185d542838be9d1
parent613f7bda1d003048ad79e7c4bba744e5057d609e (diff)
Include <unistd.h> unilaterally.
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/emacsclient.c4
-rw-r--r--lib-src/etags.c5
-rw-r--r--lib-src/fakemail.c2
-rw-r--r--lib-src/make-docfile.c2
-rw-r--r--lib-src/movemail.c2
-rw-r--r--lib-src/pop.c2
-rw-r--r--lib-src/test-distrib.c3
-rw-r--r--lib-src/update-game-score.c2
-rw-r--r--src/ChangeLog10
-rw-r--r--src/alloc.c3
-rw-r--r--src/atimer.c3
-rw-r--r--src/buffer.c3
-rw-r--r--src/callproc.c3
-rw-r--r--src/dired.c3
-rw-r--r--src/dispnew.c3
-rw-r--r--src/doc.c3
-rw-r--r--src/doprnt.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c3
-rw-r--r--src/fileio.c3
-rw-r--r--src/filelock.c3
-rw-r--r--src/fns.c2
-rw-r--r--src/getloadavg.c5
-rw-r--r--src/getpagesize.h4
-rw-r--r--src/gmalloc.c2
-rw-r--r--src/image.c3
-rw-r--r--src/keyboard.c3
-rw-r--r--src/lread.c3
-rw-r--r--src/process.c2
-rw-r--r--src/process.h3
-rw-r--r--src/ralloc.c2
-rw-r--r--src/regex.c4
-rw-r--r--src/sysdep.c2
-rw-r--r--src/systty.h2
-rw-r--r--src/term.c4
-rw-r--r--src/termcap.c2
-rw-r--r--src/xfns.c3
-rw-r--r--src/xrdb.c3
-rw-r--r--src/xselect.c3
-rw-r--r--src/xsmfns.c3
-rw-r--r--src/xterm.c3
42 files changed, 26 insertions, 104 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index cdceff66db..df9f176270 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,5 +1,11 @@
2011-01-09 Paul Eggert <[email protected]>
+ 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
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 7bf19d1147..6e52b4dfea 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -75,9 +75,7 @@ char *w32_getenv (char *);
#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>
diff --git a/lib-src/etags.c b/lib-src/etags.c
index f06e714c04..2721415adc 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 <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
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c
index 16baeb266a..b7ebe88cc5 100644
--- a/lib-src/fakemail.c
+++ b/lib-src/fakemail.c
@@ -62,9 +62,7 @@ main ()
#include <stdlib.h>
/* This is to declare cuserid. */
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
/* Type definitions */
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index e2dc99214d..43648c8abc 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 <unistd.h>
-#endif
/* Stdio stream for output to the DOC file. */
FILE *outfile;
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index f300942427..8c6a0ddcb6 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -63,9 +63,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <time.h>
#include <getopt.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 9eabbd2041..78793f1e9c 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -68,9 +68,7 @@ extern struct servent *hes_getservbyname (/* char *, char * */);
#include <string.h>
#define index strchr
#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef KERBEROS
# ifdef HAVE_KRB5_H
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c
index aca46f121f..bdb5b16049 100644
--- a/lib-src/test-distrib.c
+++ b/lib-src/test-distrib.c
@@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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. */
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index b8e1147d1c..ee4b9a3ba9 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 <http://www.gnu.org/licenses/>. */
#include <config.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include <errno.h>
#ifdef HAVE_STRING_H
#include <string.h>
diff --git a/src/ChangeLog b/src/ChangeLog
index badd1955c5..7374c4d878 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
2011-01-09 Paul Eggert <[email protected]>
+ 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.
diff --git a/src/alloc.c b/src/alloc.c
index 089a7766ca..9a249e679b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -59,9 +59,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef GC_MALLOC_CHECK
#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#else
+#ifndef HAVE_UNISTD_H
extern POINTER_TYPE *sbrk ();
#endif
diff --git a/src/atimer.c b/src/atimer.c
index 6258908e0b..56625edd9f 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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>
diff --git a/src/buffer.c b/src/buffer.c
index 9766c60da9..d85475b715 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -27,10 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdio.h>
#include <setjmp.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include "lisp.h"
#include "intervals.h"
diff --git a/src/callproc.c b/src/callproc.c
index 59067040fd..5002541035 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -25,10 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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>
diff --git a/src/dired.c b/src/dired.c
index d72ea54a51..7f3b59896e 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -31,10 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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
diff --git a/src/dispnew.c b/src/dispnew.c
index 254ee7a240..ae13cfc210 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -23,10 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include "lisp.h"
#include "termchar.h"
diff --git a/src/doc.c b/src/doc.c
index 7caa88a7b5..e57fb4d12b 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <ctype.h>
#include <setjmp.h>
#include <fcntl.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include "lisp.h"
#include "buffer.h"
diff --git a/src/doprnt.c b/src/doprnt.c
index 02adc51f1e..8bfa1c7e11 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -29,9 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <float.h>
#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include "lisp.h"
diff --git a/src/editfns.c b/src/editfns.c
index 4a9e2314a8..19eaf7ca02 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -29,9 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <pwd.h>
#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
diff --git a/src/emacs.c b/src/emacs.c
index 6a04eda9aa..dca7245f98 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -28,10 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/file.h>
#include <setjmp.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef WINDOWSNT
#include <fcntl.h>
diff --git a/src/fileio.c b/src/fileio.c
index 881dc92aca..2613939378 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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)
diff --git a/src/filelock.c b/src/filelock.c
index ae0584c447..9eb1f461cd 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -32,10 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/file.h>
#include <fcntl.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef __FreeBSD__
#include <sys/sysctl.h>
diff --git a/src/fns.c b/src/fns.c
index ddc193d85e..8fd5c7d291 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -21,9 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include <time.h>
#include <setjmp.h>
diff --git a/src/getloadavg.c b/src/getloadavg.c
index 779a0ef804..3b25e69116 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 <unistd.h>
-# endif
-
+# include <unistd.h>
# include <stdio.h>
/* 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 2ec51ab371..b69f0123dd 100644
--- a/src/getpagesize.h
+++ b/src/getpagesize.h
@@ -19,9 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
+# include <unistd.h>
# ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE)
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 8314798b17..7a5e95c743 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 <unistd.h>
-#endif
#ifdef USE_PTHREAD
#include <pthread.h>
diff --git a/src/image.c b/src/image.c
index fd1b921056..bff56b5f96 100644
--- a/src/image.c
+++ b/src/image.c
@@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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
diff --git a/src/keyboard.c b/src/keyboard.c
index 7759549fa2..a39b128d01 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -58,10 +58,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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. */
diff --git a/src/lread.c b/src/lread.c
index bc371fc02b..4c73cc36dc 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -45,10 +45,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "msdos.h"
#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
-
#include <math.h>
#ifdef HAVE_SETLOCALE
diff --git a/src/process.c b/src/process.c
index 6ffcc5b809..8f9d935e08 100644
--- a/src/process.c
+++ b/src/process.c
@@ -32,9 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <inttypes.h>
#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include <fcntl.h>
/* Only MS-DOS does not define `subprocesses'. */
diff --git a/src/process.h b/src/process.h
index 0350e95310..908304f06e 100644
--- a/src/process.h
+++ b/src/process.h
@@ -20,9 +20,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_UNISTD_H
+
#include <unistd.h>
-#endif
#ifdef HAVE_GNUTLS
#include "gnutls.h"
diff --git a/src/ralloc.c b/src/ralloc.c
index 5f2b52fcc4..9b5e3bba58 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -30,9 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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;
diff --git a/src/regex.c b/src/regex.c
index 31f188efa9..4c54a2f863 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 <unistd.h>
-# endif
+# include <unistd.h>
/* When used in Emacs's lib-src, we need xmalloc and xrealloc. */
diff --git a/src/sysdep.c b/src/sysdep.c
index ac766058d3..95efd50597 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -30,9 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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"
diff --git a/src/systty.h b/src/systty.h
index 59850e7c32..ec85818101 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -37,9 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/pty.h>
#endif /* AIX */
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
/* Special cases - inhibiting the use of certain features. */
diff --git a/src/term.c b/src/term.c
index a684edc5a8..7027ba6b75 100644
--- a/src/term.c
+++ b/src/term.c
@@ -25,11 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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>
diff --git a/src/termcap.c b/src/termcap.c
index 4ad0cee626..39ad08a66d 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -22,9 +22,7 @@ Boston, MA 02110-1301, USA. */
#include <setjmp.h>
#include <sys/file.h>
#include <fcntl.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include "lisp.h"
diff --git a/src/xfns.c b/src/xfns.c
index 32e390e1e1..0ca5fdfe8c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -24,10 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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. */
diff --git a/src/xrdb.c b/src/xrdb.c
index 8356ab8a45..d8e2dfb2c6 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
-
#include <errno.h>
#include <epaths.h>
diff --git a/src/xselect.c b/src/xselect.c
index 7b91d6f69b..ed064584cc 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -27,9 +27,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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 */
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 561fd5ee51..cea7c0247d 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -26,10 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
-
#include <sys/param.h>
#include <stdio.h>
#include <setjmp.h>
diff --git a/src/xterm.c b/src/xterm.c
index f0ef8746b0..8168eb92be 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -90,9 +90,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef HAVE_UNISTD_H
+
#include <unistd.h>
-#endif
#ifdef USE_GTK
#include "gtkutil.h"