diff options
| author | Eli Zaretskii | 2012-10-17 21:02:44 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-17 21:02:44 +0200 |
| commit | a68089e4a4dd41c9b838d82d1d96d971b01398c8 (patch) | |
| tree | 96c0226490d77760d0f783a4646c38f23cc7a688 /nt | |
| parent | 6c24e35f04e102ce8ddc4e6f9a1bc5e117a91b45 (diff) | |
| download | emacs-a68089e4a4dd41c9b838d82d1d96d971b01398c8.tar.gz emacs-a68089e4a4dd41c9b838d82d1d96d971b01398c8.zip | |
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/ChangeLog | 19 | ||||
| -rw-r--r-- | nt/config.nt | 2 | ||||
| -rwxr-xr-x | nt/configure.bat | 2 | ||||
| -rw-r--r-- | nt/gmake.defs | 2 | ||||
| -rw-r--r-- | nt/inc/grp.h | 5 | ||||
| -rw-r--r-- | nt/inc/ms-w32.h | 56 | ||||
| -rw-r--r-- | nt/inc/pwd.h | 7 |
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 @@ | |||
| 1 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * inc/pwd.h (getuid, geteuid): Add prototypes. | ||
| 4 | |||
| 5 | * inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r) | ||
| 6 | (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask) | ||
| 7 | (pthread_sigmask, sigismember, setpgrp, sigaction, alarm) | ||
| 8 | (sys_kill, getpagesize): Add prototypes for emulated functions. | ||
| 9 | |||
| 10 | * inc/grp.h (getgid, getegid): Add prototypes. | ||
| 11 | |||
| 12 | * gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99. | ||
| 13 | |||
| 14 | * configure.bat (chkapiN): Avoid compiler warning in junk.c when | ||
| 15 | compiling with -std=gnu99. | ||
| 16 | |||
| 17 | * config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it | ||
| 18 | could be used via --cflags switch to configure.bat. | ||
| 19 | |||
| 1 | 2012-10-08 Juanma Barranquero <lekktu@gmail.com> | 20 | 2012-10-08 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 21 | ||
| 3 | * config.nt: Sync with autogen/config.in. | 22 | * 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/>. */ | |||
| 76 | #undef CANNOT_DUMP | 76 | #undef CANNOT_DUMP |
| 77 | 77 | ||
| 78 | /* Define this to enable compile time checks for the Lisp_Object data type. */ | 78 | /* Define this to enable compile time checks for the Lisp_Object data type. */ |
| 79 | #undef CHECK_LISP_OBJECT_TYPE | 79 | /* #undef CHECK_LISP_OBJECT_TYPE */ |
| 80 | 80 | ||
| 81 | /* Define if you want lock files to be written, so that Emacs can tell | 81 | /* Define if you want lock files to be written, so that Emacs can tell |
| 82 | instantly when you try to modify a file that someone else has modified in | 82 | 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 | |||
| 429 | echo Checking whether Windows API headers are too old... | 429 | echo Checking whether Windows API headers are too old... |
| 430 | echo #include "windows.h" >junk.c | 430 | echo #include "windows.h" >junk.c |
| 431 | echo #include "usp10.h" >>junk.c | 431 | echo #include "usp10.h" >>junk.c |
| 432 | echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c | 432 | echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c |
| 433 | echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c | 433 | echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c |
| 434 | if (%nocygwin%) == (Y) goto chkapi1 | 434 | if (%nocygwin%) == (Y) goto chkapi1 |
| 435 | set cf=%usercflags% | 435 | 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)) | |||
| 211 | OBJ2_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) | 211 | OBJ2_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) |
| 212 | 212 | ||
| 213 | ifdef NOOPT | 213 | ifdef NOOPT |
| 214 | DEBUG_CFLAGS = -DEMACSDEBUG -fno-crossjumping | 214 | DEBUG_CFLAGS = -DEMACSDEBUG -fno-crossjumping -std=gnu99 |
| 215 | else | 215 | else |
| 216 | DEBUG_CFLAGS = | 216 | DEBUG_CFLAGS = |
| 217 | endif | 217 | 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 { | |||
| 28 | gid_t gr_gid; /* group numerical ID */ | 28 | gid_t gr_gid; /* group numerical ID */ |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | struct group *getgrgid(gid_t); | 31 | extern unsigned getgid (void); |
| 32 | extern unsigned getegid (void); | ||
| 33 | |||
| 34 | extern struct group *getgrgid(gid_t); | ||
| 32 | 35 | ||
| 33 | #endif /* _GRP_H */ | 36 | #endif /* _GRP_H */ |
| 34 | 37 | ||
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 (); | |||
| 120 | #endif | 120 | #endif |
| 121 | #include <sys/types.h> | 121 | #include <sys/types.h> |
| 122 | 122 | ||
| 123 | #ifdef _MSC_VER | ||
| 124 | typedef int sigset_t; | ||
| 125 | typedef int ssize_t; | ||
| 126 | #endif | ||
| 127 | |||
| 128 | struct sigaction { | ||
| 129 | int sa_flags; | ||
| 130 | void (_CALLBACK_ *sa_handler)(int); | ||
| 131 | sigset_t sa_mask; | ||
| 132 | }; | ||
| 133 | #define SA_RESTART 0 | ||
| 134 | #define SIG_BLOCK 1 | ||
| 135 | #define SIG_SETMASK 2 | ||
| 136 | #define SIG_UNBLOCK 3 | ||
| 137 | |||
| 138 | #ifndef MAXPATHLEN | 123 | #ifndef MAXPATHLEN |
| 139 | #define MAXPATHLEN _MAX_PATH | 124 | #define MAXPATHLEN _MAX_PATH |
| 140 | #endif | 125 | #endif |
| @@ -207,6 +192,8 @@ struct sigaction { | |||
| 207 | /* Internal signals. */ | 192 | /* Internal signals. */ |
| 208 | #define emacs_raise(sig) emacs_abort() | 193 | #define emacs_raise(sig) emacs_abort() |
| 209 | 194 | ||
| 195 | extern int sys_wait (int *); | ||
| 196 | |||
| 210 | /* termcap.c calls that are emulated. */ | 197 | /* termcap.c calls that are emulated. */ |
| 211 | #define tputs sys_tputs | 198 | #define tputs sys_tputs |
| 212 | #define tgetstr sys_tgetstr | 199 | #define tgetstr sys_tgetstr |
| @@ -251,6 +238,9 @@ typedef int pid_t; | |||
| 251 | #define stricmp _stricmp | 238 | #define stricmp _stricmp |
| 252 | #define tzset _tzset | 239 | #define tzset _tzset |
| 253 | 240 | ||
| 241 | /* We cannot include system header process.h, since there's src/process.h. */ | ||
| 242 | int _getpid (void); | ||
| 243 | |||
| 254 | /* Include time.h before redirecting tzname, since MSVC's time.h | 244 | /* Include time.h before redirecting tzname, since MSVC's time.h |
| 255 | defines _tzname to call a function, but also declares tzname a | 245 | defines _tzname to call a function, but also declares tzname a |
| 256 | 2-element array. Having the redirection before including the | 246 | 2-element array. Having the redirection before including the |
| @@ -272,6 +262,10 @@ struct timespec | |||
| 272 | long int tv_nsec; /* nanoseconds */ | 262 | long int tv_nsec; /* nanoseconds */ |
| 273 | }; | 263 | }; |
| 274 | 264 | ||
| 265 | /* Required for functions in lib/time_r.c, since we don't use lib/time.h. */ | ||
| 266 | extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); | ||
| 267 | extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); | ||
| 268 | |||
| 275 | /* This is hacky, but is necessary to avoid warnings about macro | 269 | /* This is hacky, but is necessary to avoid warnings about macro |
| 276 | redefinitions using the SDK compilers. */ | 270 | redefinitions using the SDK compilers. */ |
| 277 | #ifndef __STDC__ | 271 | #ifndef __STDC__ |
| @@ -300,6 +294,37 @@ struct timespec | |||
| 300 | #define NSIG 23 | 294 | #define NSIG 23 |
| 301 | #endif | 295 | #endif |
| 302 | 296 | ||
| 297 | #ifdef _MSC_VER | ||
| 298 | typedef int sigset_t; | ||
| 299 | typedef int ssize_t; | ||
| 300 | #endif | ||
| 301 | |||
| 302 | typedef void (_CALLBACK_ *signal_handler) (int); | ||
| 303 | extern signal_handler sys_signal (int, signal_handler); | ||
| 304 | |||
| 305 | struct sigaction { | ||
| 306 | int sa_flags; | ||
| 307 | void (_CALLBACK_ *sa_handler)(int); | ||
| 308 | sigset_t sa_mask; | ||
| 309 | }; | ||
| 310 | #define SA_RESTART 0 | ||
| 311 | #define SIG_BLOCK 1 | ||
| 312 | #define SIG_SETMASK 2 | ||
| 313 | #define SIG_UNBLOCK 3 | ||
| 314 | |||
| 315 | extern int sigemptyset (sigset_t *); | ||
| 316 | extern int sigaddset (sigset_t *, int); | ||
| 317 | extern int sigfillset (sigset_t *); | ||
| 318 | extern int sigprocmask (int, const sigset_t *, sigset_t *); | ||
| 319 | extern int pthread_sigmask (int, const sigset_t *, sigset_t *); | ||
| 320 | extern int sigismember (const sigset_t *, int); | ||
| 321 | extern int setpgrp (int, int); | ||
| 322 | extern int sigaction (int, const struct sigaction *, struct sigaction *); | ||
| 323 | extern int alarm (int); | ||
| 324 | |||
| 325 | extern int sys_kill (int, int); | ||
| 326 | |||
| 327 | |||
| 303 | /* For integration with MSDOS support. */ | 328 | /* For integration with MSDOS support. */ |
| 304 | #define getdisk() (_getdrive () - 1) | 329 | #define getdisk() (_getdrive () - 1) |
| 305 | #ifdef emacs | 330 | #ifdef emacs |
| @@ -357,6 +382,7 @@ extern char *get_emacs_configuration_options (void); | |||
| 357 | #endif | 382 | #endif |
| 358 | 383 | ||
| 359 | extern int getloadavg (double *, int); | 384 | extern int getloadavg (double *, int); |
| 385 | extern int getpagesize (void); | ||
| 360 | 386 | ||
| 361 | #if defined (__MINGW32__) | 387 | #if defined (__MINGW32__) |
| 362 | 388 | ||
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 { | |||
| 18 | typedef unsigned uid_t; | 18 | typedef unsigned uid_t; |
| 19 | typedef uid_t gid_t; | 19 | typedef uid_t gid_t; |
| 20 | 20 | ||
| 21 | struct passwd * getpwnam (char *); | 21 | extern unsigned getuid (void); |
| 22 | struct passwd * getpwuid (unsigned); | 22 | extern unsigned geteuid (void); |
| 23 | |||
| 24 | extern struct passwd * getpwnam (char *); | ||
| 25 | extern struct passwd * getpwuid (unsigned); | ||
| 23 | 26 | ||
| 24 | 27 | ||
| 25 | #endif /* _PWD_H_ */ | 28 | #endif /* _PWD_H_ */ |