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 /src | |
| 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 'src')
| -rw-r--r-- | src/ChangeLog | 34 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/fileio.c | 1 | ||||
| -rw-r--r-- | src/makefile.w32-in | 7 | ||||
| -rw-r--r-- | src/process.c | 5 | ||||
| -rw-r--r-- | src/term.c | 1 | ||||
| -rw-r--r-- | src/unexw32.c | 2 | ||||
| -rw-r--r-- | src/vm-limit.c | 2 | ||||
| -rw-r--r-- | src/w32.c | 12 | ||||
| -rw-r--r-- | src/w32.h | 22 | ||||
| -rw-r--r-- | src/w32proc.c | 3 | ||||
| -rw-r--r-- | src/w32term.h | 3 |
12 files changed, 91 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3a6fb718e41..827850e332d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,39 @@ | |||
| 1 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> | 1 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * makefile.w32-in ($(BLD)/w32.$(O)): | ||
| 4 | ($(BLD)/vm-limit.$(O)): | ||
| 5 | ($(BLD)/term.$(O)): | ||
| 6 | ($(BLD)/unexw32.$(O)): | ||
| 7 | ($(BLD)/fileio.$(O)): | ||
| 8 | ($(BLD)/dispnew.$(O)): Update dependencies. | ||
| 9 | |||
| 10 | * w32term.h (w32_initialize_display_info, initialize_w32_display): | ||
| 11 | Add prototypes. | ||
| 12 | |||
| 13 | * w32proc.c: Include ctype.h. | ||
| 14 | |||
| 15 | * w32.h (init_environment, check_windows_init_file) | ||
| 16 | (syms_of_ntproc, syms_of_ntterm, dostounix_filename) | ||
| 17 | (unixtodos_filename, init_winsock, srandom, random, sys_pipe) | ||
| 18 | (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd) | ||
| 19 | (sys_link): Add prototypes. | ||
| 20 | |||
| 21 | * w32.c: Include w32select.h. | ||
| 22 | (sys_access, e_malloc, sys_select): Add prototypes. | ||
| 23 | (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval. | ||
| 24 | |||
| 25 | * vm-limit.c [WINDOWSNT]: Include w32heap.h. | ||
| 26 | |||
| 27 | * unexw32.c: Include lisp.h and w32.h. | ||
| 28 | |||
| 29 | * term.c [WINDOWSNT]: Include w32term.h. | ||
| 30 | |||
| 31 | * process.c [WINDOWSNT]: Add prototype of sys_select. | ||
| 32 | |||
| 33 | * fileio.c [WINDOWSNT]: Include w32.h. | ||
| 34 | |||
| 35 | * dispnew.c [WINDOWSNT]: Include w32.h. | ||
| 36 | |||
| 3 | * cygw32.c (Fcygwin_convert_path_to_windows) | 37 | * cygw32.c (Fcygwin_convert_path_to_windows) |
| 4 | (Fcygwin_convert_path_from_windows): Use EQ to compare 2 | 38 | (Fcygwin_convert_path_from_windows): Use EQ to compare 2 |
| 5 | Lisp_Object values. (Bug#12661) | 39 | Lisp_Object values. (Bug#12661) |
diff --git a/src/dispnew.c b/src/dispnew.c index 0956e3f2905..fa24408aa43 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -60,6 +60,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 60 | #if defined (HAVE_TERM_H) && defined (GNU_LINUX) | 60 | #if defined (HAVE_TERM_H) && defined (GNU_LINUX) |
| 61 | #include <term.h> /* for tgetent */ | 61 | #include <term.h> /* for tgetent */ |
| 62 | #endif | 62 | #endif |
| 63 | |||
| 64 | #ifdef WINDOWSNT | ||
| 65 | #include "w32.h" | ||
| 66 | #endif | ||
| 63 | 67 | ||
| 64 | /* Structure to pass dimensions around. Used for character bounding | 68 | /* Structure to pass dimensions around. Used for character bounding |
| 65 | boxes, glyph matrix dimensions and alike. */ | 69 | boxes, glyph matrix dimensions and alike. */ |
diff --git a/src/fileio.c b/src/fileio.c index e3a91c2c9da..d47d7dd9e0b 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -53,6 +53,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 53 | #include <windows.h> | 53 | #include <windows.h> |
| 54 | #include <fcntl.h> | 54 | #include <fcntl.h> |
| 55 | #include <sys/file.h> | 55 | #include <sys/file.h> |
| 56 | #include "w32.h" | ||
| 56 | #endif /* not WINDOWSNT */ | 57 | #endif /* not WINDOWSNT */ |
| 57 | 58 | ||
| 58 | #ifdef MSDOS | 59 | #ifdef MSDOS |
diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 2acce9c123f..5be1ccb70df 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in | |||
| @@ -735,6 +735,7 @@ $(BLD)/dispnew.$(O) : \ | |||
| 735 | $(SRC)/disptab.h \ | 735 | $(SRC)/disptab.h \ |
| 736 | $(SRC)/indent.h \ | 736 | $(SRC)/indent.h \ |
| 737 | $(SRC)/termchar.h \ | 737 | $(SRC)/termchar.h \ |
| 738 | $(SRC)/w32.h \ | ||
| 738 | $(NT_INC)/unistd.h \ | 739 | $(NT_INC)/unistd.h \ |
| 739 | $(BUFFER_H) \ | 740 | $(BUFFER_H) \ |
| 740 | $(CHARACTER_H) \ | 741 | $(CHARACTER_H) \ |
| @@ -832,6 +833,7 @@ $(BLD)/fileio.$(O) : \ | |||
| 832 | $(SRC)/fileio.c \ | 833 | $(SRC)/fileio.c \ |
| 833 | $(SRC)/blockinput.h \ | 834 | $(SRC)/blockinput.h \ |
| 834 | $(SRC)/commands.h \ | 835 | $(SRC)/commands.h \ |
| 836 | $(SRC)/w32.h \ | ||
| 835 | $(NT_INC)/pwd.h \ | 837 | $(NT_INC)/pwd.h \ |
| 836 | $(NT_INC)/sys/file.h \ | 838 | $(NT_INC)/sys/file.h \ |
| 837 | $(NT_INC)/sys/stat.h \ | 839 | $(NT_INC)/sys/stat.h \ |
| @@ -1173,6 +1175,7 @@ $(BLD)/w32.$(O) : \ | |||
| 1173 | $(SRC)/w32.h \ | 1175 | $(SRC)/w32.h \ |
| 1174 | $(SRC)/w32common.h \ | 1176 | $(SRC)/w32common.h \ |
| 1175 | $(SRC)/w32heap.h \ | 1177 | $(SRC)/w32heap.h \ |
| 1178 | $(SRC)/w32select.h \ | ||
| 1176 | $(NT_INC)/pwd.h \ | 1179 | $(NT_INC)/pwd.h \ |
| 1177 | $(NT_INC)/sys/file.h \ | 1180 | $(NT_INC)/sys/file.h \ |
| 1178 | $(NT_INC)/sys/time.h \ | 1181 | $(NT_INC)/sys/time.h \ |
| @@ -1428,6 +1431,7 @@ $(BLD)/term.$(O) : \ | |||
| 1428 | $(SYSSIGNAL_H) \ | 1431 | $(SYSSIGNAL_H) \ |
| 1429 | $(SYSTTY_H) \ | 1432 | $(SYSTTY_H) \ |
| 1430 | $(TERMHOOKS_H) \ | 1433 | $(TERMHOOKS_H) \ |
| 1434 | $(W32TERM_H) \ | ||
| 1431 | $(WINDOW_H) | 1435 | $(WINDOW_H) |
| 1432 | 1436 | ||
| 1433 | $(BLD)/terminal.$(O) : \ | 1437 | $(BLD)/terminal.$(O) : \ |
| @@ -1468,13 +1472,16 @@ $(BLD)/undo.$(O) : \ | |||
| 1468 | $(BLD)/unexw32.$(O) : \ | 1472 | $(BLD)/unexw32.$(O) : \ |
| 1469 | $(SRC)/unexw32.c \ | 1473 | $(SRC)/unexw32.c \ |
| 1470 | $(SRC)/unexec.h \ | 1474 | $(SRC)/unexec.h \ |
| 1475 | $(SRC)/w32.h \ | ||
| 1471 | $(SRC)/w32common.h \ | 1476 | $(SRC)/w32common.h \ |
| 1472 | $(SRC)/w32heap.h \ | 1477 | $(SRC)/w32heap.h \ |
| 1478 | $(LISP_H) \ | ||
| 1473 | $(CONFIG_H) | 1479 | $(CONFIG_H) |
| 1474 | 1480 | ||
| 1475 | $(BLD)/vm-limit.$(O) : \ | 1481 | $(BLD)/vm-limit.$(O) : \ |
| 1476 | $(SRC)/vm-limit.c \ | 1482 | $(SRC)/vm-limit.c \ |
| 1477 | $(SRC)/mem-limits.h \ | 1483 | $(SRC)/mem-limits.h \ |
| 1484 | $(SRC)/w32heap.h \ | ||
| 1478 | $(NT_INC)/unistd.h \ | 1485 | $(NT_INC)/unistd.h \ |
| 1479 | $(CONFIG_H) \ | 1486 | $(CONFIG_H) \ |
| 1480 | $(LISP_H) | 1487 | $(LISP_H) |
diff --git a/src/process.c b/src/process.c index d45a2c6e8e0..307e82819d6 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -125,6 +125,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 125 | #include "xgselect.h" | 125 | #include "xgselect.h" |
| 126 | #endif | 126 | #endif |
| 127 | 127 | ||
| 128 | #ifdef WINDOWSNT | ||
| 129 | extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, | ||
| 130 | EMACS_TIME *, void *); | ||
| 131 | #endif | ||
| 132 | |||
| 128 | #ifndef WNOHANG | 133 | #ifndef WNOHANG |
| 129 | # undef waitpid | 134 | # undef waitpid |
| 130 | # define waitpid(pid, status, options) wait (status) | 135 | # define waitpid(pid, status, options) wait (status) |
diff --git a/src/term.c b/src/term.c index acce9c0548c..f7c87b7608d 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -66,6 +66,7 @@ static int been_here = -1; | |||
| 66 | /* The name of the default console device. */ | 66 | /* The name of the default console device. */ |
| 67 | #ifdef WINDOWSNT | 67 | #ifdef WINDOWSNT |
| 68 | #define DEV_TTY "CONOUT$" | 68 | #define DEV_TTY "CONOUT$" |
| 69 | #include "w32term.h" | ||
| 69 | #else | 70 | #else |
| 70 | #define DEV_TTY "/dev/tty" | 71 | #define DEV_TTY "/dev/tty" |
| 71 | #endif | 72 | #endif |
diff --git a/src/unexw32.c b/src/unexw32.c index 82671d0f120..1e591a78b73 100644 --- a/src/unexw32.c +++ b/src/unexw32.c | |||
| @@ -22,7 +22,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 22 | 22 | ||
| 23 | #include <config.h> | 23 | #include <config.h> |
| 24 | #include "unexec.h" | 24 | #include "unexec.h" |
| 25 | #include "lisp.h" | ||
| 25 | #include "w32common.h" | 26 | #include "w32common.h" |
| 27 | #include "w32.h" | ||
| 26 | 28 | ||
| 27 | #include <stdio.h> | 29 | #include <stdio.h> |
| 28 | #include <fcntl.h> | 30 | #include <fcntl.h> |
diff --git a/src/vm-limit.c b/src/vm-limit.c index 3020b84858a..2a71e88695a 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c | |||
| @@ -85,6 +85,8 @@ get_lim_data (void) | |||
| 85 | #else /* not USG */ | 85 | #else /* not USG */ |
| 86 | #ifdef WINDOWSNT | 86 | #ifdef WINDOWSNT |
| 87 | 87 | ||
| 88 | #include "w32heap.h" | ||
| 89 | |||
| 88 | static void | 90 | static void |
| 89 | get_lim_data (void) | 91 | get_lim_data (void) |
| 90 | { | 92 | { |
| @@ -175,6 +175,7 @@ typedef struct _REPARSE_DATA_BUFFER { | |||
| 175 | #include "ndir.h" | 175 | #include "ndir.h" |
| 176 | #include "w32common.h" | 176 | #include "w32common.h" |
| 177 | #include "w32heap.h" | 177 | #include "w32heap.h" |
| 178 | #include "w32select.h" | ||
| 178 | #include "systime.h" | 179 | #include "systime.h" |
| 179 | #include "dispextern.h" /* for xstrcasecmp */ | 180 | #include "dispextern.h" /* for xstrcasecmp */ |
| 180 | #include "coding.h" /* for Vlocale_coding_system */ | 181 | #include "coding.h" /* for Vlocale_coding_system */ |
| @@ -198,6 +199,12 @@ static int enable_privilege (LPCTSTR, BOOL, TOKEN_PRIVILEGES *); | |||
| 198 | static int restore_privilege (TOKEN_PRIVILEGES *); | 199 | static int restore_privilege (TOKEN_PRIVILEGES *); |
| 199 | static BOOL WINAPI revert_to_self (void); | 200 | static BOOL WINAPI revert_to_self (void); |
| 200 | 201 | ||
| 202 | extern int sys_access (const char *, int); | ||
| 203 | extern void *e_malloc (size_t); | ||
| 204 | extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, | ||
| 205 | EMACS_TIME *, void *); | ||
| 206 | |||
| 207 | |||
| 201 | 208 | ||
| 202 | /* Initialization states. | 209 | /* Initialization states. |
| 203 | 210 | ||
| @@ -6961,7 +6968,7 @@ emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz) | |||
| 6961 | { | 6968 | { |
| 6962 | int n, sc, err; | 6969 | int n, sc, err; |
| 6963 | SELECT_TYPE fdset; | 6970 | SELECT_TYPE fdset; |
| 6964 | struct timeval timeout; | 6971 | EMACS_TIME timeout; |
| 6965 | struct Lisp_Process *process = (struct Lisp_Process *)p; | 6972 | struct Lisp_Process *process = (struct Lisp_Process *)p; |
| 6966 | int fd = process->infd; | 6973 | int fd = process->infd; |
| 6967 | 6974 | ||
| @@ -6977,8 +6984,7 @@ emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz) | |||
| 6977 | if (err == EWOULDBLOCK) | 6984 | if (err == EWOULDBLOCK) |
| 6978 | { | 6985 | { |
| 6979 | /* Set a small timeout. */ | 6986 | /* Set a small timeout. */ |
| 6980 | timeout.tv_sec = 1; | 6987 | timeout = make_emacs_time (1, 0); |
| 6981 | timeout.tv_usec = 0; | ||
| 6982 | FD_ZERO (&fdset); | 6988 | FD_ZERO (&fdset); |
| 6983 | FD_SET ((int)fd, &fdset); | 6989 | FD_SET ((int)fd, &fdset); |
| 6984 | 6990 | ||
| @@ -146,6 +146,28 @@ extern int _sys_wait_accept (int fd); | |||
| 146 | extern Lisp_Object QCloaded_from; | 146 | extern Lisp_Object QCloaded_from; |
| 147 | extern HMODULE w32_delayed_load (Lisp_Object); | 147 | extern HMODULE w32_delayed_load (Lisp_Object); |
| 148 | 148 | ||
| 149 | extern void init_environment (char **); | ||
| 150 | extern void check_windows_init_file (void); | ||
| 151 | extern void syms_of_ntproc (void); | ||
| 152 | extern void syms_of_ntterm (void); | ||
| 153 | extern void dostounix_filename (register char *); | ||
| 154 | extern void unixtodos_filename (register char *); | ||
| 155 | extern BOOL init_winsock (int load_now); | ||
| 156 | extern void srandom (int); | ||
| 157 | extern int random (void); | ||
| 158 | |||
| 159 | extern int sys_pipe (int *); | ||
| 160 | |||
| 161 | extern void set_process_dir (char *); | ||
| 162 | extern int sys_spawnve (int, char *, char **, char **); | ||
| 163 | extern void register_child (int, int); | ||
| 164 | |||
| 165 | extern void sys_sleep (int); | ||
| 166 | extern char *getwd (char *); | ||
| 167 | extern int sys_link (const char *, const char *); | ||
| 168 | |||
| 169 | |||
| 170 | |||
| 149 | #ifdef HAVE_GNUTLS | 171 | #ifdef HAVE_GNUTLS |
| 150 | #include <gnutls/gnutls.h> | 172 | #include <gnutls/gnutls.h> |
| 151 | 173 | ||
diff --git a/src/w32proc.c b/src/w32proc.c index 7e8183b0e82..57b3860cb76 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 24 | #include <stdio.h> | 24 | #include <stdio.h> |
| 25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
| 26 | #include <errno.h> | 26 | #include <errno.h> |
| 27 | #include <ctype.h> | ||
| 27 | #include <io.h> | 28 | #include <io.h> |
| 28 | #include <fcntl.h> | 29 | #include <fcntl.h> |
| 29 | #include <signal.h> | 30 | #include <signal.h> |
| @@ -68,8 +69,6 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD); | |||
| 68 | 69 | ||
| 69 | Lisp_Object Qhigh, Qlow; | 70 | Lisp_Object Qhigh, Qlow; |
| 70 | 71 | ||
| 71 | typedef void (_CALLBACK_ *signal_handler) (int); | ||
| 72 | |||
| 73 | /* Signal handlers...SIG_DFL == 0 so this is initialized correctly. */ | 72 | /* Signal handlers...SIG_DFL == 0 so this is initialized correctly. */ |
| 74 | static signal_handler sig_handlers[NSIG]; | 73 | static signal_handler sig_handlers[NSIG]; |
| 75 | 74 | ||
diff --git a/src/w32term.h b/src/w32term.h index 83f9e7b98dc..af5b37a1171 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -681,6 +681,9 @@ extern BOOL parse_button (int, int, int *, int *); | |||
| 681 | 681 | ||
| 682 | extern void w32_sys_ring_bell (struct frame *f); | 682 | extern void w32_sys_ring_bell (struct frame *f); |
| 683 | extern void x_delete_display (struct w32_display_info *dpyinfo); | 683 | extern void x_delete_display (struct w32_display_info *dpyinfo); |
| 684 | extern void w32_initialize_display_info (Lisp_Object); | ||
| 685 | extern void initialize_w32_display (struct terminal *); | ||
| 686 | |||
| 684 | 687 | ||
| 685 | /* Keypad command key support. W32 doesn't have virtual keys defined | 688 | /* Keypad command key support. W32 doesn't have virtual keys defined |
| 686 | for the function keys on the keypad (they are mapped to the standard | 689 | for the function keys on the keypad (they are mapped to the standard |