aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Colascione2012-10-08 04:53:18 -0800
committerDaniel Colascione2012-10-08 04:53:18 -0800
commit501199a3dbccc83f91a561c6664ae4c1d3dde20a (patch)
treec9b24607e5e44b61fad483b10a0c77862d4d2661 /src
parentc54ebba4e076caeb6105c6bb682252b139a169fa (diff)
downloademacs-501199a3dbccc83f91a561c6664ae4c1d3dde20a.tar.gz
emacs-501199a3dbccc83f91a561c6664ae4c1d3dde20a.zip
Code cleanup for cygw32
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog53
-rw-r--r--src/Makefile.in2
-rw-r--r--src/cygw32.c8
-rw-r--r--src/cygw32.h5
-rw-r--r--src/emacs.c9
-rw-r--r--src/unexcw.c1
-rw-r--r--src/unexw32.c1
-rw-r--r--src/w32.c1
-rw-r--r--src/w32common.h53
-rw-r--r--src/w32console.c2
-rw-r--r--src/w32fns.c19
-rw-r--r--src/w32heap.c16
-rw-r--r--src/w32heap.h23
-rw-r--r--src/w32menu.c2
-rw-r--r--src/w32proc.c1
-rw-r--r--src/w32select.c2
-rw-r--r--src/w32select.h2
-rw-r--r--src/w32term.h6
18 files changed, 139 insertions, 67 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9e8377c2f7c..b252f5deef8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -11,6 +11,59 @@
11 11
122012-10-08 Daniel Colascione <dancol@dancol.org> 122012-10-08 Daniel Colascione <dancol@dancol.org>
13 13
14 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
15 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
16 accidental message numbering hole. Change other messages to
17 match.
18
19 * w32select.h (HAVE_W32SELECT): Remove.
20
21 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
22 w32common.h instead of w32heap.h
23
24 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
25 (get_allocation_unit, get_processor_type, get_w32_major_version)
26 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
27 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
28 (OS_NT, os_subtype, cache_system_info): Move declarations to
29 w32common.
30
31 * w32heap.c: Include w32common.h.
32 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
33 (w32_minor_version, w32_build_number, w32_subtype): Remove
34 duplicate definitions.
35
36 * w32fns.c: Include w32common.h; include w32heap.h only in
37 WINDOWSNT.
38
39 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
40 Use `report_file_error' instead of `error' in order to better
41 inform users of what went wrong. Increase NTGUI_UNICODE file
42 dialog box file name length to 32k, the maximum allowed by the NT
43 kernel.
44
45 * w32common.h: New file.
46 (ROUND_UP, ROUND_DOWN, get_page_size)
47 (get_allocation_unit, get_processor_type, get_w32_major_version)
48 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
49 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
50 (OS_NT, os_subtype, cache_system_info): Move here.
51
52 * unexw32.c, unexcw.c: Include w32common.h.
53
54 * emacs.c (main): Use (defined (WINDOWSNT) || defined
55 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
56 to call syms_of_w32select.
57
58 * cygw32.h: Remove obsolete EXFUN declarations.
59
60 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
61
62 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
63 of w32inevt.o from SOME_MACHINE_OBJECTS.
64
652012-10-08 Daniel Colascione <dancol@dancol.org>
66
14 * image.c: Permanent fix for JPEG compilation issue --- limit 67 * image.c: Permanent fix for JPEG compilation issue --- limit
15 jpeglib `boolean' redefinition to Cygwin builds. 68 jpeglib `boolean' redefinition to Cygwin builds.
16 69
diff --git a/src/Makefile.in b/src/Makefile.in
index e704f2f5c0c..c24e421bbbc 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -357,7 +357,7 @@ SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
357 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ 357 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
358 fontset.o dbusbind.o cygw32.o \ 358 fontset.o dbusbind.o cygw32.o \
359 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \ 359 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
360 w32.o w32console.o w32fns.o w32heap.o \ 360 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
361 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \ 361 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
362 w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \ 362 w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
363 xsettings.o xgselect.o termcap.o 363 xsettings.o xgselect.o termcap.o
diff --git a/src/cygw32.c b/src/cygw32.c
index ab7ee91a138..c45a45648e9 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -22,7 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include "buffer.h" 22#include "buffer.h"
23#include <unistd.h> 23#include <unistd.h>
24#include <fcntl.h> 24#include <fcntl.h>
25static Lisp_Object Qutf_16_le; 25static Lisp_Object Qutf_16le;
26 26
27static Lisp_Object 27static Lisp_Object
28fchdir_unwind (Lisp_Object dir_fd) 28fchdir_unwind (Lisp_Object dir_fd)
@@ -117,13 +117,13 @@ from_unicode (Lisp_Object str)
117 str = Fsubstring (str, make_number (0), make_number (-1)); 117 str = Fsubstring (str, make_number (0), make_number (-1));
118 } 118 }
119 119
120 return code_convert_string_norecord (str, Qutf_16_le, 0); 120 return code_convert_string_norecord (str, Qutf_16le, 0);
121} 121}
122 122
123wchar_t * 123wchar_t *
124to_unicode (Lisp_Object str, Lisp_Object *buf) 124to_unicode (Lisp_Object str, Lisp_Object *buf)
125{ 125{
126 *buf = code_convert_string_norecord (str, Qutf_16_le, 1); 126 *buf = code_convert_string_norecord (str, Qutf_16le, 1);
127 /* We need to make a another copy (in addition to the one made by 127 /* We need to make a another copy (in addition to the one made by
128 code_convert_string_norecord) to ensure that the final string is 128 code_convert_string_norecord) to ensure that the final string is
129 _doubly_ zero terminated --- that is, that the string is 129 _doubly_ zero terminated --- that is, that the string is
@@ -163,7 +163,7 @@ void
163syms_of_cygw32 (void) 163syms_of_cygw32 (void)
164{ 164{
165 /* No, not utf-16-le: that one has a BOM. */ 165 /* No, not utf-16-le: that one has a BOM. */
166 DEFSYM (Qutf_16_le, "utf-16le"); 166 DEFSYM (Qutf_16le, "utf-16le");
167 defsubr (&Scygwin_convert_path_from_windows); 167 defsubr (&Scygwin_convert_path_from_windows);
168 defsubr (&Scygwin_convert_path_to_windows); 168 defsubr (&Scygwin_convert_path_to_windows);
169} 169}
diff --git a/src/cygw32.h b/src/cygw32.h
index 22b6f5692da..78e77a9a141 100644
--- a/src/cygw32.h
+++ b/src/cygw32.h
@@ -46,11 +46,6 @@ extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf);
46 object, to a multi-byte Emacs string, and return it. */ 46 object, to a multi-byte Emacs string, and return it. */
47extern Lisp_Object from_unicode (Lisp_Object str); 47extern Lisp_Object from_unicode (Lisp_Object str);
48 48
49/* *** Path conversion. *** */
50
51EXFUN (Fcygwin_convert_path_to_windows, 2);
52EXFUN (Fcygwin_convert_path_from_windows, 2);
53
54/* *** Misc *** */ 49/* *** Misc *** */
55extern void syms_of_cygw32 (void); 50extern void syms_of_cygw32 (void);
56extern char * w32_strerror (int error_no); 51extern char * w32_strerror (int error_no);
diff --git a/src/emacs.c b/src/emacs.c
index 0a9cc484f7a..203514fe204 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1415,9 +1415,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1415 syms_of_fontset (); 1415 syms_of_fontset ();
1416#endif /* HAVE_NTGUI */ 1416#endif /* HAVE_NTGUI */
1417 1417
1418#ifdef HAVE_W32SELECT 1418#if defined (WINDOWSNT) || defined (HAVE_NTGUI)
1419 syms_of_w32select (); 1419 syms_of_w32select ();
1420#endif /* HAVE_W32SELECT */ 1420#endif /* WINDOWSNT || HAVE_NTGUI */
1421 1421
1422#ifdef MSDOS 1422#ifdef MSDOS
1423 syms_of_xmenu (); 1423 syms_of_xmenu ();
@@ -1465,9 +1465,10 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1465 globals_of_w32menu (); 1465 globals_of_w32menu ();
1466#endif /* HAVE_NTGUI */ 1466#endif /* HAVE_NTGUI */
1467 1467
1468#ifdef HAVE_W32SELECT 1468#if defined (WINDOWSNT) || defined (HAVE_NTGUI)
1469 globals_of_w32select (); 1469 globals_of_w32select ();
1470#endif /* HAVE_W32SELECT */ 1470#endif /* WINDOWSNT || HAVE_NTGUI */
1471
1471 } 1472 }
1472 1473
1473 init_charset (); 1474 init_charset ();
diff --git a/src/unexcw.c b/src/unexcw.c
index 96c4b4a9aec..8c5d574530d 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include "unexec.h" 22#include "unexec.h"
23#include "w32common.h"
23 24
24#include <lisp.h> 25#include <lisp.h>
25#include <stdio.h> 26#include <stdio.h>
diff --git a/src/unexw32.c b/src/unexw32.c
index d57378b2421..82671d0f120 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -22,6 +22,7 @@ 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 "w32common.h"
25 26
26#include <stdio.h> 27#include <stdio.h>
27#include <fcntl.h> 28#include <fcntl.h>
diff --git a/src/w32.c b/src/w32.c
index 85210cb8e4c..b50cd13517d 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -173,6 +173,7 @@ typedef struct _REPARSE_DATA_BUFFER {
173 173
174#include "w32.h" 174#include "w32.h"
175#include "ndir.h" 175#include "ndir.h"
176#include "w32common.h"
176#include "w32heap.h" 177#include "w32heap.h"
177#include "systime.h" 178#include "systime.h"
178#include "dispextern.h" /* for xstrcasecmp */ 179#include "dispextern.h" /* for xstrcasecmp */
diff --git a/src/w32common.h b/src/w32common.h
new file mode 100644
index 00000000000..50724e5553c
--- /dev/null
+++ b/src/w32common.h
@@ -0,0 +1,53 @@
1/* Common functions for Microsoft Windows builds of Emacs
2 Copyright (C) 2012 Free Software Foundation, Inc.
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef W32COMMON_H
22#define W32COMMON_H
23
24#include <windows.h>
25
26#define ROUND_UP(p, align) (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1))
27#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1))
28
29#define get_page_size() sysinfo_cache.dwPageSize
30#define get_allocation_unit() sysinfo_cache.dwAllocationGranularity
31#define get_processor_type() sysinfo_cache.dwProcessorType
32#define get_w32_major_version() w32_major_version
33#define get_w32_minor_version() w32_minor_version
34
35extern SYSTEM_INFO sysinfo_cache;
36extern OSVERSIONINFO osinfo_cache;
37extern unsigned long syspage_mask;
38
39extern int w32_major_version;
40extern int w32_minor_version;
41extern int w32_build_number;
42
43enum {
44 OS_9X = 1,
45 OS_NT
46};
47
48extern int os_subtype;
49
50/* Cache system info, e.g., the NT page size. */
51extern void cache_system_info (void);
52
53#endif /* W32COMMON_H */
diff --git a/src/w32console.c b/src/w32console.c
index 5a44d3748a2..f0574689bf1 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -37,7 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
37#include "termchar.h" 37#include "termchar.h"
38#include "dispextern.h" 38#include "dispextern.h"
39#include "w32term.h" 39#include "w32term.h"
40#include "w32heap.h" /* for os_subtype */ 40#include "w32common.h" /* for os_subtype */
41#include "w32inevt.h" 41#include "w32inevt.h"
42 42
43/* from window.c */ 43/* from window.c */
diff --git a/src/w32fns.c b/src/w32fns.c
index 8620fa8b1e8..e728d19a9b3 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -45,7 +45,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#include "systime.h" 45#include "systime.h"
46#include "termhooks.h" 46#include "termhooks.h"
47 47
48#include "w32common.h"
49
50#ifdef WINDOWSNT
48#include "w32heap.h" 51#include "w32heap.h"
52#endif /* WINDOWSNT */
49 53
50#if CYGWIN 54#if CYGWIN
51#include "cygw32.h" 55#include "cygw32.h"
@@ -6111,7 +6115,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
6111 } new_file_details; 6115 } new_file_details;
6112 6116
6113#ifdef NTGUI_UNICODE 6117#ifdef NTGUI_UNICODE
6114 wchar_t filename_buf[MAX_PATH + 1]; 6118 wchar_t filename_buf[32*1024 + 1]; // NT kernel maximum
6115 OPENFILENAMEW * file_details = &new_file_details.details; 6119 OPENFILENAMEW * file_details = &new_file_details.details;
6116#else /* not NTGUI_UNICODE */ 6120#else /* not NTGUI_UNICODE */
6117 char filename_buf[MAX_PATH + 1]; 6121 char filename_buf[MAX_PATH + 1];
@@ -6173,11 +6177,12 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
6173 unixtodos_filename (SDATA (filename)); 6177 unixtodos_filename (SDATA (filename));
6174#endif /* NTGUI_UNICODE */ 6178#endif /* NTGUI_UNICODE */
6175 6179
6176 /* Fill in the structure for the call to GetOpenFileName below. For 6180 /* Fill in the structure for the call to GetOpenFileName below.
6177 NTGUI_UNICODE builds (which run only on NT), we just use the 6181 For NTGUI_UNICODE builds (which run only on NT), we just use
6178 actual size of the structure. For non-NTGUI_UNICODE builds, we 6182 the actual size of the structure. For non-NTGUI_UNICODE
6179 tell the OS we're using an old version of the structure if it's not 6183 builds, we tell the OS we're using an old version of the
6180 new enough to support the newer version. */ 6184 structure if the OS isn't new enough to support the newer
6185 version. */
6181 memset (&new_file_details, 0, sizeof (new_file_details)); 6186 memset (&new_file_details, 0, sizeof (new_file_details));
6182 6187
6183 if (w32_major_version > 4 && w32_major_version < 95) 6188 if (w32_major_version > 4 && w32_major_version < 95)
@@ -6187,7 +6192,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
6187 6192
6188 /* Set up the inout parameter for the selected file name. */ 6193 /* Set up the inout parameter for the selected file name. */
6189 if (SBYTES (filename) + 1 > sizeof (filename_buf)) 6194 if (SBYTES (filename) + 1 > sizeof (filename_buf))
6190 error ("filename too long"); 6195 report_file_error ("filename too long", default_filename);
6191 6196
6192 memcpy (filename_buf, SDATA (filename), SBYTES (filename) + 1); 6197 memcpy (filename_buf, SDATA (filename), SBYTES (filename) + 1);
6193 file_details->lpstrFile = filename_buf; 6198 file_details->lpstrFile = filename_buf;
diff --git a/src/w32heap.c b/src/w32heap.c
index 0ff473fb0a8..311e1064434 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -23,26 +23,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <config.h> 23#include <config.h>
24#include <stdio.h> 24#include <stdio.h>
25 25
26#include "w32common.h"
26#include "w32heap.h" 27#include "w32heap.h"
27#include "lisp.h" /* for VALMASK */ 28#include "lisp.h" /* for VALMASK */
28 29
29#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD_PTR)(rva) + (DWORD_PTR)GetModuleHandle (NULL))) 30#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD_PTR)(rva) + (DWORD_PTR)GetModuleHandle (NULL)))
30 31
31/* This gives us the page size and the size of the allocation unit on NT. */
32SYSTEM_INFO sysinfo_cache;
33
34/* This gives us version, build, and platform identification. */
35extern unsigned long syspage_mask;
36OSVERSIONINFO osinfo_cache;
37
38/* The major and minor versions of NT. */
39int w32_major_version;
40int w32_minor_version;
41int w32_build_number;
42
43/* Distinguish between Windows NT and Windows 95. */
44int os_subtype;
45
46/* Emulate getpagesize. */ 32/* Emulate getpagesize. */
47int 33int
48getpagesize (void) 34getpagesize (void)
diff --git a/src/w32heap.h b/src/w32heap.h
index aae4845b4cc..1630864875f 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -24,9 +24,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 24
25#include <windows.h> 25#include <windows.h>
26 26
27#define ROUND_UP(p, align) (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1))
28#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1))
29
30/* 27/*
31 * Heap related stuff. 28 * Heap related stuff.
32 */ 29 */
@@ -34,28 +31,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
34#define get_committed_heap_size() (get_data_end () - get_data_start ()) 31#define get_committed_heap_size() (get_data_end () - get_data_start ())
35#define get_heap_start() get_data_start () 32#define get_heap_start() get_data_start ()
36#define get_heap_end() get_data_end () 33#define get_heap_end() get_data_end ()
37#define get_page_size() sysinfo_cache.dwPageSize
38#define get_allocation_unit() sysinfo_cache.dwAllocationGranularity
39#define get_processor_type() sysinfo_cache.dwProcessorType
40#define get_w32_major_version() w32_major_version
41#define get_w32_minor_version() w32_minor_version
42 34
43extern unsigned char *get_data_start (void); 35extern unsigned char *get_data_start (void);
44extern unsigned char *get_data_end (void); 36extern unsigned char *get_data_end (void);
45extern size_t reserved_heap_size; 37extern size_t reserved_heap_size;
46extern SYSTEM_INFO sysinfo_cache;
47extern OSVERSIONINFO osinfo_cache;
48extern BOOL using_dynamic_heap; 38extern BOOL using_dynamic_heap;
49extern int w32_major_version;
50extern int w32_minor_version;
51extern int w32_build_number;
52
53enum {
54 OS_9X = 1,
55 OS_NT
56};
57
58extern int os_subtype;
59 39
60/* Emulation of Unix sbrk(). */ 40/* Emulation of Unix sbrk(). */
61extern void *sbrk (ptrdiff_t size); 41extern void *sbrk (ptrdiff_t size);
@@ -66,9 +46,6 @@ extern void init_heap (void);
66/* Round the heap to this size. */ 46/* Round the heap to this size. */
67extern void round_heap (size_t size); 47extern void round_heap (size_t size);
68 48
69/* Cache system info, e.g., the NT page size. */
70extern void cache_system_info (void);
71
72/* ----------------------------------------------------------------- */ 49/* ----------------------------------------------------------------- */
73/* Useful routines for manipulating memory-mapped files. */ 50/* Useful routines for manipulating memory-mapped files. */
74 51
diff --git a/src/w32menu.c b/src/w32menu.c
index 40ee82d42d5..36bf9574fdc 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -56,7 +56,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
56 56
57#include "dispextern.h" 57#include "dispextern.h"
58 58
59#include "w32heap.h" /* for osinfo_cache */ 59#include "w32common.h" /* for osinfo_cache */
60 60
61#undef HAVE_DIALOGS /* TODO: Implement native dialogs. */ 61#undef HAVE_DIALOGS /* TODO: Implement native dialogs. */
62 62
diff --git a/src/w32proc.c b/src/w32proc.c
index 7d0039d0d5e..7e8183b0e82 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -51,6 +51,7 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD);
51 51
52#include "lisp.h" 52#include "lisp.h"
53#include "w32.h" 53#include "w32.h"
54#include "w32common.h"
54#include "w32heap.h" 55#include "w32heap.h"
55#include "systime.h" 56#include "systime.h"
56#include "syswait.h" 57#include "syswait.h"
diff --git a/src/w32select.c b/src/w32select.c
index 1690c3b7824..ee0e6d16b11 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -75,7 +75,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
75#include <config.h> 75#include <config.h>
76#include "lisp.h" 76#include "lisp.h"
77#include "w32term.h" /* for all of the w32 includes */ 77#include "w32term.h" /* for all of the w32 includes */
78#include "w32heap.h" /* os_subtype */ 78#include "w32common.h" /* os_subtype */
79#include "blockinput.h" 79#include "blockinput.h"
80#include "charset.h" 80#include "charset.h"
81#include "coding.h" 81#include "coding.h"
diff --git a/src/w32select.h b/src/w32select.h
index 6924d4d51ae..e895c3d9bf2 100644
--- a/src/w32select.h
+++ b/src/w32select.h
@@ -21,8 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#define W32SELECT_H 21#define W32SELECT_H
22#include <windows.h> 22#include <windows.h>
23 23
24#define HAVE_W32SELECT 1
25
26extern void syms_of_w32select (void); 24extern void syms_of_w32select (void);
27extern void globals_of_w32select (void); 25extern void globals_of_w32select (void);
28extern void term_w32select (void); 26extern void term_w32select (void);
diff --git a/src/w32term.h b/src/w32term.h
index 9fb37b9f030..83f9e7b98dc 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -619,9 +619,9 @@ do { \
619#define WM_EMACS_HIDE_CARET (WM_EMACS_START + 18) 619#define WM_EMACS_HIDE_CARET (WM_EMACS_START + 18)
620#define WM_EMACS_SETCURSOR (WM_EMACS_START + 19) 620#define WM_EMACS_SETCURSOR (WM_EMACS_START + 19)
621#define WM_EMACS_PAINT (WM_EMACS_START + 20) 621#define WM_EMACS_PAINT (WM_EMACS_START + 20)
622#define WM_EMACS_BRINGTOTOP (WM_EMACS_START + 22) 622#define WM_EMACS_BRINGTOTOP (WM_EMACS_START + 21)
623#define WM_EMACS_INPUT_READY (WM_EMACS_START + 23) 623#define WM_EMACS_INPUT_READY (WM_EMACS_START + 22)
624#define WM_EMACS_END (WM_EMACS_START + 24) 624#define WM_EMACS_END (WM_EMACS_START + 23)
625 625
626#define WND_FONTWIDTH_INDEX (0) 626#define WND_FONTWIDTH_INDEX (0)
627#define WND_LINEHEIGHT_INDEX (4) 627#define WND_LINEHEIGHT_INDEX (4)