summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2012-10-17 21:02:44 +0200
committerEli Zaretskii <eliz@gnu.org>2012-10-17 21:02:44 +0200
commita68089e4a4dd41c9b838d82d1d96d971b01398c8 (patch)
tree96c0226490d77760d0f783a4646c38f23cc7a688 /nt
parent6c24e35f04e102ce8ddc4e6f9a1bc5e117a91b45 (diff)
downloademacs-a68089e4a4dd41c9b838d82d1d96d971b01398c8.tar.gz
Fix warnings when compiling on MS-Windows with -std=gnu99.
src/makefile.w32-in ($(BLD)/w32.$(O)): ($(BLD)/vm-limit.$(O)): ($(BLD)/term.$(O)): ($(BLD)/unexw32.$(O)): ($(BLD)/fileio.$(O)): ($(BLD)/dispnew.$(O)): Update dependencies. src/w32term.h (w32_initialize_display_info, initialize_w32_display): Add prototypes. src/w32proc.c: Include ctype.h. src/w32.h (init_environment, check_windows_init_file) (syms_of_ntproc, syms_of_ntterm, dostounix_filename) (unixtodos_filename, init_winsock, srandom, random, sys_pipe) (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd) (sys_link): Add prototypes. src/w32.c: Include w32select.h. (sys_access, e_malloc, sys_select): Add prototypes. (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval. src/vm-limit.c [WINDOWSNT]: Include w32heap.h. src/unexw32.c: Include lisp.h and w32.h. src/term.c [WINDOWSNT]: Include w32term.h. src/process.c [WINDOWSNT]: Add prototype of sys_select. src/fileio.c [WINDOWSNT]: Include w32.h. src/dispnew.c [WINDOWSNT]: Include w32.h. nt/inc/pwd.h (getuid, geteuid): Add prototypes. nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r) (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask) (pthread_sigmask, sigismember, setpgrp, sigaction, alarm) (sys_kill, getpagesize): Add prototypes for emulated functions. nt/inc/grp.h (getgid, getegid): Add prototypes. nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99. nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when compiling with -std=gnu99. nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it could be used via --cflags switch to configure.bat.
Diffstat (limited to 'nt')
-rw-r--r--nt/ChangeLog19
-rw-r--r--nt/config.nt2
-rwxr-xr-xnt/configure.bat2
-rw-r--r--nt/gmake.defs2
-rw-r--r--nt/inc/grp.h5
-rw-r--r--nt/inc/ms-w32.h56
-rw-r--r--nt/inc/pwd.h7
7 files changed, 72 insertions, 21 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 4b0a65a59da..94d2ce18551 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,22 @@
+2012-10-17 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/pwd.h (getuid, geteuid): Add prototypes.
+
+ * inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
+ (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
+ (pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
+ (sys_kill, getpagesize): Add prototypes for emulated functions.
+
+ * inc/grp.h (getgid, getegid): Add prototypes.
+
+ * gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
+
+ * configure.bat (chkapiN): Avoid compiler warning in junk.c when
+ compiling with -std=gnu99.
+
+ * config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
+ could be used via --cflags switch to configure.bat.
+
2012-10-08 Juanma Barranquero <lekktu@gmail.com>
* config.nt: Sync with autogen/config.in.
diff --git a/nt/config.nt b/nt/config.nt
index cd695bc4e34..4582928cb5a 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -76,7 +76,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef CANNOT_DUMP
/* Define this to enable compile time checks for the Lisp_Object data type. */
-#undef CHECK_LISP_OBJECT_TYPE
+/* #undef CHECK_LISP_OBJECT_TYPE */
/* Define if you want lock files to be written, so that Emacs can tell
instantly when you try to modify a file that someone else has modified in
diff --git a/nt/configure.bat b/nt/configure.bat
index 7fedff411bc..3118bb11e5d 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -429,7 +429,7 @@ rem
echo Checking whether Windows API headers are too old...
echo #include "windows.h" >junk.c
echo #include "usp10.h" >>junk.c
-echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c
+echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c
echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c
if (%nocygwin%) == (Y) goto chkapi1
set cf=%usercflags%
diff --git a/nt/gmake.defs b/nt/gmake.defs
index 7206237c47a..358c262db28 100644
--- a/nt/gmake.defs
+++ b/nt/gmake.defs
@@ -211,7 +211,7 @@ OBJ1_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
OBJ2_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2))
ifdef NOOPT
-DEBUG_CFLAGS = -DEMACSDEBUG -fno-crossjumping
+DEBUG_CFLAGS = -DEMACSDEBUG -fno-crossjumping -std=gnu99
else
DEBUG_CFLAGS =
endif
diff --git a/nt/inc/grp.h b/nt/inc/grp.h
index 8c3131ac893..3d369044974 100644
--- a/nt/inc/grp.h
+++ b/nt/inc/grp.h
@@ -28,7 +28,10 @@ struct group {
gid_t gr_gid; /* group numerical ID */
};
-struct group *getgrgid(gid_t);
+extern unsigned getgid (void);
+extern unsigned getegid (void);
+
+extern struct group *getgrgid(gid_t);
#endif /* _GRP_H */
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 06a3af937df..dd2ae781cb8 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -120,21 +120,6 @@ extern char *getenv ();
#endif
#include <sys/types.h>
-#ifdef _MSC_VER
-typedef int sigset_t;
-typedef int ssize_t;
-#endif
-
-struct sigaction {
- int sa_flags;
- void (_CALLBACK_ *sa_handler)(int);
- sigset_t sa_mask;
-};
-#define SA_RESTART 0
-#define SIG_BLOCK 1
-#define SIG_SETMASK 2
-#define SIG_UNBLOCK 3
-
#ifndef MAXPATHLEN
#define MAXPATHLEN _MAX_PATH
#endif
@@ -207,6 +192,8 @@ struct sigaction {
/* Internal signals. */
#define emacs_raise(sig) emacs_abort()
+extern int sys_wait (int *);
+
/* termcap.c calls that are emulated. */
#define tputs sys_tputs
#define tgetstr sys_tgetstr
@@ -251,6 +238,9 @@ typedef int pid_t;
#define stricmp _stricmp
#define tzset _tzset
+/* We cannot include system header process.h, since there's src/process.h. */
+int _getpid (void);
+
/* Include time.h before redirecting tzname, since MSVC's time.h
defines _tzname to call a function, but also declares tzname a
2-element array. Having the redirection before including the
@@ -272,6 +262,10 @@ struct timespec
long int tv_nsec; /* nanoseconds */
};
+/* Required for functions in lib/time_r.c, since we don't use lib/time.h. */
+extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
+extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
+
/* This is hacky, but is necessary to avoid warnings about macro
redefinitions using the SDK compilers. */
#ifndef __STDC__
@@ -300,6 +294,37 @@ struct timespec
#define NSIG 23
#endif
+#ifdef _MSC_VER
+typedef int sigset_t;
+typedef int ssize_t;
+#endif
+
+typedef void (_CALLBACK_ *signal_handler) (int);
+extern signal_handler sys_signal (int, signal_handler);
+
+struct sigaction {
+ int sa_flags;
+ void (_CALLBACK_ *sa_handler)(int);
+ sigset_t sa_mask;
+};
+#define SA_RESTART 0
+#define SIG_BLOCK 1
+#define SIG_SETMASK 2
+#define SIG_UNBLOCK 3
+
+extern int sigemptyset (sigset_t *);
+extern int sigaddset (sigset_t *, int);
+extern int sigfillset (sigset_t *);
+extern int sigprocmask (int, const sigset_t *, sigset_t *);
+extern int pthread_sigmask (int, const sigset_t *, sigset_t *);
+extern int sigismember (const sigset_t *, int);
+extern int setpgrp (int, int);
+extern int sigaction (int, const struct sigaction *, struct sigaction *);
+extern int alarm (int);
+
+extern int sys_kill (int, int);
+
+
/* For integration with MSDOS support. */
#define getdisk() (_getdrive () - 1)
#ifdef emacs
@@ -357,6 +382,7 @@ extern char *get_emacs_configuration_options (void);
#endif
extern int getloadavg (double *, int);
+extern int getpagesize (void);
#if defined (__MINGW32__)
diff --git a/nt/inc/pwd.h b/nt/inc/pwd.h
index b39309d08fa..54e477e9665 100644
--- a/nt/inc/pwd.h
+++ b/nt/inc/pwd.h
@@ -18,8 +18,11 @@ struct passwd {
typedef unsigned uid_t;
typedef uid_t gid_t;
-struct passwd * getpwnam (char *);
-struct passwd * getpwuid (unsigned);
+extern unsigned getuid (void);
+extern unsigned geteuid (void);
+
+extern struct passwd * getpwnam (char *);
+extern struct passwd * getpwuid (unsigned);
#endif /* _PWD_H_ */