aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2012-10-18 09:00:39 +0900
committerKenichi Handa2012-10-18 09:00:39 +0900
commit03d24a8276767e9618d073fa92c3a2c55d6962bf (patch)
tree410cf3dc7cc7b8a14d6677065e043c876ef9603b
parentb278604edf862feced13457cfed15bcf7ac63f76 (diff)
parent27067208fd133e8b9530aafe43b0eed13ec08c21 (diff)
downloademacs-03d24a8276767e9618d073fa92c3a2c55d6962bf.tar.gz
emacs-03d24a8276767e9618d073fa92c3a2c55d6962bf.zip
merge trunk
-rw-r--r--doc/emacs/ChangeLog8
-rw-r--r--doc/emacs/mini.texi4
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/ntlib.c1
-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
-rw-r--r--src/ChangeLog43
-rw-r--r--src/cygw32.c4
-rw-r--r--src/dispnew.c4
-rw-r--r--src/fileio.c1
-rw-r--r--src/makefile.w32-in7
-rw-r--r--src/process.c5
-rw-r--r--src/term.c1
-rw-r--r--src/unexw32.c2
-rw-r--r--src/vm-limit.c2
-rw-r--r--src/w32.c12
-rw-r--r--src/w32.h22
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32proc.c3
-rw-r--r--src/w32term.h3
25 files changed, 192 insertions, 32 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 5ab3c1ab5b8..873681ad0d4 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,11 @@
12012-10-17 Glenn Morris <rgm@gnu.org>
2
3 * mini.texi (Repetition): Further copyedit.
4
52012-10-17 Dani Moncayo <dmoncayo@gmail.com>
6
7 * mini.texi (Repetition): Copyedit.
8
12012-10-16 Juri Linkov <juri@jurta.org> 92012-10-16 Juri Linkov <juri@jurta.org>
2 10
3 * search.texi (Query Replace): Document multi-buffer replacement 11 * search.texi (Query Replace): Document multi-buffer replacement
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index cb47a966f64..0036b67f174 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -683,13 +683,13 @@ the text for that expression. Even if you don't know Lisp, it will
683probably be obvious which command is displayed for repetition. If you 683probably be obvious which command is displayed for repetition. If you
684type just @key{RET}, that repeats the command unchanged. You can also 684type just @key{RET}, that repeats the command unchanged. You can also
685change the command by editing the Lisp expression before you execute 685change the command by editing the Lisp expression before you execute
686it. The repeated command is added to the front of the command history 686it. The executed command is added to the front of the command history
687unless it is identical to the most recent item. 687unless it is identical to the most recent item.
688 688
689 Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you 689 Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you
690can use the usual minibuffer history commands (@pxref{Minibuffer 690can use the usual minibuffer history commands (@pxref{Minibuffer
691History}) to move through the history list. After finding the desired 691History}) to move through the history list. After finding the desired
692previous command, you can edit its expression as usual and then repeat 692previous command, you can edit its expression as usual and then execute
693it by typing @key{RET}. 693it by typing @key{RET}.
694 694
695@vindex isearch-resume-in-command-history 695@vindex isearch-resume-in-command-history
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 85351d7f08d..1f28000e110 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12012-10-17 Eli Zaretskii <eliz@gnu.org>
2
3 * ntlib.c: Include <mbstring.h>, to avoid compiler warning about
4 _mbspbrk.
5
12012-10-08 Eli Zaretskii <eliz@gnu.org> 62012-10-08 Eli Zaretskii <eliz@gnu.org>
2 7
3 * makefile.w32-in (obj): Add cygw32.o. 8 * makefile.w32-in (obj): Add cygw32.o.
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index feaad1c1bb7..4e125eb6d73 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -30,6 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include <errno.h> 30#include <errno.h>
31#include <ctype.h> 31#include <ctype.h>
32#include <sys/timeb.h> 32#include <sys/timeb.h>
33#include <mbstring.h>
33 34
34#include "ntlib.h" 35#include "ntlib.h"
35 36
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 4b0a65a59da..94d2ce18551 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,22 @@
12012-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
12012-10-08 Juanma Barranquero <lekktu@gmail.com> 202012-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
429echo Checking whether Windows API headers are too old... 429echo Checking whether Windows API headers are too old...
430echo #include "windows.h" >junk.c 430echo #include "windows.h" >junk.c
431echo #include "usp10.h" >>junk.c 431echo #include "usp10.h" >>junk.c
432echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c 432echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c
433echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c 433echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c
434if (%nocygwin%) == (Y) goto chkapi1 434if (%nocygwin%) == (Y) goto chkapi1
435set cf=%usercflags% 435set 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))
211OBJ2_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) 211OBJ2_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2))
212 212
213ifdef NOOPT 213ifdef NOOPT
214DEBUG_CFLAGS = -DEMACSDEBUG -fno-crossjumping 214DEBUG_CFLAGS = -DEMACSDEBUG -fno-crossjumping -std=gnu99
215else 215else
216DEBUG_CFLAGS = 216DEBUG_CFLAGS =
217endif 217endif
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
31struct group *getgrgid(gid_t); 31extern unsigned getgid (void);
32extern unsigned getegid (void);
33
34extern 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
124typedef int sigset_t;
125typedef int ssize_t;
126#endif
127
128struct 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
195extern 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. */
242int _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. */
266extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
267extern 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
298typedef int sigset_t;
299typedef int ssize_t;
300#endif
301
302typedef void (_CALLBACK_ *signal_handler) (int);
303extern signal_handler sys_signal (int, signal_handler);
304
305struct 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
315extern int sigemptyset (sigset_t *);
316extern int sigaddset (sigset_t *, int);
317extern int sigfillset (sigset_t *);
318extern int sigprocmask (int, const sigset_t *, sigset_t *);
319extern int pthread_sigmask (int, const sigset_t *, sigset_t *);
320extern int sigismember (const sigset_t *, int);
321extern int setpgrp (int, int);
322extern int sigaction (int, const struct sigaction *, struct sigaction *);
323extern int alarm (int);
324
325extern 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
359extern int getloadavg (double *, int); 384extern int getloadavg (double *, int);
385extern 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 {
18typedef unsigned uid_t; 18typedef unsigned uid_t;
19typedef uid_t gid_t; 19typedef uid_t gid_t;
20 20
21struct passwd * getpwnam (char *); 21extern unsigned getuid (void);
22struct passwd * getpwuid (unsigned); 22extern unsigned geteuid (void);
23
24extern struct passwd * getpwnam (char *);
25extern struct passwd * getpwuid (unsigned);
23 26
24 27
25#endif /* _PWD_H_ */ 28#endif /* _PWD_H_ */
diff --git a/src/ChangeLog b/src/ChangeLog
index b845eeb3ceb..827850e332d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,46 @@
12012-10-17 Eli Zaretskii <eliz@gnu.org>
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
37 * cygw32.c (Fcygwin_convert_path_to_windows)
38 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
39 Lisp_Object values. (Bug#12661)
40
41 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
42 to Lisp_Object. (Bug#12661)
43
12012-10-17 Kenichi Handa <handa@gnu.org> 442012-10-17 Kenichi Handa <handa@gnu.org>
2 45
3 * xdisp.c (reseat_1): Make the information stored in it->cmp_it 46 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
diff --git a/src/cygw32.c b/src/cygw32.c
index c45a45648e9..8f63461da2a 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -145,7 +145,7 @@ DEFUN ("cygwin-convert-path-to-windows",
145 (Lisp_Object path, Lisp_Object absolute_p) 145 (Lisp_Object path, Lisp_Object absolute_p)
146{ 146{
147 return from_unicode ( 147 return from_unicode (
148 conv_filename_to_w32_unicode (path, absolute_p == Qnil ? 0 : 1)); 148 conv_filename_to_w32_unicode (path, EQ (absolute_p, Qnil) ? 0 : 1));
149} 149}
150 150
151DEFUN ("cygwin-convert-path-from-windows", 151DEFUN ("cygwin-convert-path-from-windows",
@@ -156,7 +156,7 @@ DEFUN ("cygwin-convert-path-from-windows",
156 (Lisp_Object path, Lisp_Object absolute_p) 156 (Lisp_Object path, Lisp_Object absolute_p)
157{ 157{
158 return conv_filename_from_w32_unicode (to_unicode (path, &path), 158 return conv_filename_from_w32_unicode (to_unicode (path, &path),
159 absolute_p == Qnil ? 0 : 1); 159 EQ (absolute_p, Qnil) ? 0 : 1);
160} 160}
161 161
162void 162void
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
129extern 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
88static void 90static void
89get_lim_data (void) 91get_lim_data (void)
90{ 92{
diff --git a/src/w32.c b/src/w32.c
index babbcc6df9f..5ac1bc3eb7c 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -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 *);
198static int restore_privilege (TOKEN_PRIVILEGES *); 199static int restore_privilege (TOKEN_PRIVILEGES *);
199static BOOL WINAPI revert_to_self (void); 200static BOOL WINAPI revert_to_self (void);
200 201
202extern int sys_access (const char *, int);
203extern void *e_malloc (size_t);
204extern 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
diff --git a/src/w32.h b/src/w32.h
index c4cfdf5fedd..8309a3cc23d 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -146,6 +146,28 @@ extern int _sys_wait_accept (int fd);
146extern Lisp_Object QCloaded_from; 146extern Lisp_Object QCloaded_from;
147extern HMODULE w32_delayed_load (Lisp_Object); 147extern HMODULE w32_delayed_load (Lisp_Object);
148 148
149extern void init_environment (char **);
150extern void check_windows_init_file (void);
151extern void syms_of_ntproc (void);
152extern void syms_of_ntterm (void);
153extern void dostounix_filename (register char *);
154extern void unixtodos_filename (register char *);
155extern BOOL init_winsock (int load_now);
156extern void srandom (int);
157extern int random (void);
158
159extern int sys_pipe (int *);
160
161extern void set_process_dir (char *);
162extern int sys_spawnve (int, char *, char **, char **);
163extern void register_child (int, int);
164
165extern void sys_sleep (int);
166extern char *getwd (char *);
167extern 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/w32fns.c b/src/w32fns.c
index c5e4be4ffc9..8dd3eb83c60 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2424,7 +2424,7 @@ w32_msg_pump (deferred_msg * msg_buf)
2424 thread-safe. The next line is okay because the cons 2424 thread-safe. The next line is okay because the cons
2425 cell is never made into garbage and is not relocated by 2425 cell is never made into garbage and is not relocated by
2426 GC. */ 2426 GC. */
2427 XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil); 2427 XSETCAR (XIL ((EMACS_INT) msg.lParam), Qnil);
2428 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) 2428 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
2429 emacs_abort (); 2429 emacs_abort ();
2430 break; 2430 break;
@@ -2432,7 +2432,7 @@ w32_msg_pump (deferred_msg * msg_buf)
2432 { 2432 {
2433 int vk_code = (int) msg.wParam; 2433 int vk_code = (int) msg.wParam;
2434 int cur_state = (GetKeyState (vk_code) & 1); 2434 int cur_state = (GetKeyState (vk_code) & 1);
2435 Lisp_Object new_state = (Lisp_Object) ((EMACS_INT) msg.lParam); 2435 Lisp_Object new_state = XIL ((EMACS_INT) msg.lParam);
2436 2436
2437 /* NB: This code must be thread-safe. It is safe to 2437 /* NB: This code must be thread-safe. It is safe to
2438 call NILP because symbols are not relocated by GC, 2438 call NILP because symbols are not relocated by GC,
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
69Lisp_Object Qhigh, Qlow; 70Lisp_Object Qhigh, Qlow;
70 71
71typedef 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. */
74static signal_handler sig_handlers[NSIG]; 73static 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
682extern void w32_sys_ring_bell (struct frame *f); 682extern void w32_sys_ring_bell (struct frame *f);
683extern void x_delete_display (struct w32_display_info *dpyinfo); 683extern void x_delete_display (struct w32_display_info *dpyinfo);
684extern void w32_initialize_display_info (Lisp_Object);
685extern 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