aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog41
-rw-r--r--lib-src/emacsclient.c198
-rw-r--r--lib-src/make-docfile.c41
-rw-r--r--lib-src/makefile.w32-in48
-rw-r--r--lib-src/ntlib.c1
5 files changed, 219 insertions, 110 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 2a8ac9b8131..bcb71daca5d 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,44 @@
12012-10-20 Eli Zaretskii <eliz@gnu.org>
2
3 * make-docfile.c (IS_SLASH, DEF_ELISP_FILE): New macros.
4 (scan_lisp_file): Only pass a .el file if its basename matches a
5 known file in its entirety. Use IS_SLASH and DEF_ELISP_FILE.
6
72012-10-20 Andreas Schwab <schwab@linux-m68k.org>
8
9 * make-docfile.c (scan_lisp_file): Add bounds checking.
10
112012-10-20 Eli Zaretskii <eliz@gnu.org>
12
13 Prevent silent omission of doc strings from uncompiled Lisp files.
14 * make-docfile.c (scan_lisp_file): Barf if called with a .el file
15 other than one of a small list of supported un-compiled files.
16
17 * makefile.w32-in (lisp1, lisp2): Name .elc files wherever they
18 exist. (Bug#12395)
19
202012-10-17 Eli Zaretskii <eliz@gnu.org>
21
22 * ntlib.c: Include <mbstring.h>, to avoid compiler warning about
23 _mbspbrk.
24
252012-10-08 Eli Zaretskii <eliz@gnu.org>
26
27 * makefile.w32-in (obj): Add cygw32.o.
28
292012-10-08 Daniel Colascione <dancol@dancol.org>
30
31 * emacsclient.c: Include windows.h when HAVE_NTGUI.
32 (alt_display): New variable. We send the display held by this
33 variable when the primary display is either unsupported or not
34 present.
35 (longopts): Allow display everywhere.
36 (w32_set_user_model_id): Move lower in file, inside HAVE_NTGUI
37 section.
38 (decode_options): Use alt_display. Explain why.
39 (main): Retry connection with alt_display if connection with main
40 display fails.
41
12012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com> 422012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2 43
3 * make-docfile.c (write_globals): Special-case 44 * make-docfile.c (write_globals): Special-case
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 07300dbf249..8d60d7961da 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -44,6 +44,10 @@ char *w32_getenv (char *);
44 44
45#else /* !WINDOWSNT */ 45#else /* !WINDOWSNT */
46 46
47# ifdef HAVE_NTGUI
48# include <windows.h>
49# endif /* HAVE_NTGUI */
50
47# include "syswait.h" 51# include "syswait.h"
48 52
49# ifdef HAVE_INET_SOCKETS 53# ifdef HAVE_INET_SOCKETS
@@ -140,6 +144,9 @@ int current_frame = 1;
140/* The display on which Emacs should work. --display. */ 144/* The display on which Emacs should work. --display. */
141const char *display = NULL; 145const char *display = NULL;
142 146
147/* The alternate display we should try if Emacs does not support display. */
148const char *alt_display = NULL;
149
143/* The parent window ID, if we are opening a frame via XEmbed. */ 150/* The parent window ID, if we are opening a frame via XEmbed. */
144char *parent_id = NULL; 151char *parent_id = NULL;
145 152
@@ -182,9 +189,7 @@ struct option longopts[] =
182 { "socket-name", required_argument, NULL, 's' }, 189 { "socket-name", required_argument, NULL, 's' },
183#endif 190#endif
184 { "server-file", required_argument, NULL, 'f' }, 191 { "server-file", required_argument, NULL, 'f' },
185#ifndef WINDOWSNT
186 { "display", required_argument, NULL, 'd' }, 192 { "display", required_argument, NULL, 'd' },
187#endif
188 { "parent-id", required_argument, NULL, 'p' }, 193 { "parent-id", required_argument, NULL, 'p' },
189 { 0, 0, 0, 0 } 194 { 0, 0, 0, 0 }
190}; 195};
@@ -385,32 +390,6 @@ w32_getenv (char *envvar)
385 return NULL; 390 return NULL;
386} 391}
387 392
388void
389w32_set_user_model_id (void)
390{
391 HMODULE shell;
392 HRESULT (WINAPI * set_user_model) (wchar_t * id);
393
394 /* On Windows 7 and later, we need to set the user model ID
395 to associate emacsclient launched files with Emacs frames
396 in the UI. */
397 shell = LoadLibrary ("shell32.dll");
398 if (shell)
399 {
400 set_user_model
401 = (void *) GetProcAddress (shell,
402 "SetCurrentProcessExplicitAppUserModelID");
403 /* If the function is defined, then we are running on Windows 7
404 or newer, and the UI uses this to group related windows
405 together. Since emacs, runemacs, emacsclient are related, we
406 want them grouped even though the executables are different,
407 so we need to set a consistent ID between them. */
408 if (set_user_model)
409 set_user_model (L"GNU.Emacs");
410
411 FreeLibrary (shell);
412 }
413}
414 393
415int 394int
416w32_window_app (void) 395w32_window_app (void)
@@ -605,16 +584,29 @@ decode_options (int argc, char **argv)
605 Without the -c option, we used to set `display' to $DISPLAY by 584 Without the -c option, we used to set `display' to $DISPLAY by
606 default, but this changed the default behavior and is sometimes 585 default, but this changed the default behavior and is sometimes
607 inconvenient. So we force users to use "--display $DISPLAY" if 586 inconvenient. So we force users to use "--display $DISPLAY" if
608 they want Emacs to connect to their current display. */ 587 they want Emacs to connect to their current display.
588
589 Some window systems have a notion of default display not
590 reflected in the DISPLAY variable. If the user didn't give us an
591 explicit display, try this platform-specific after trying the
592 display in DISPLAY (if any). */
609 if (!current_frame && !tty && !display) 593 if (!current_frame && !tty && !display)
610 { 594 {
611 display = egetenv ("DISPLAY"); 595 /* Set these here so we use a default_display only when the user
612#ifdef NS_IMPL_COCOA 596 didn't give us an explicit display. */
613 /* Under Cocoa, we don't really use displays the same way as in X, 597#if defined (NS_IMPL_COCOA)
614 so provide a dummy. */ 598 alt_display = "ns";
615 if (!display || strlen (display) == 0) 599#elif defined (HAVE_NTGUI)
616 display = "ns"; 600 alt_display = "w32";
617#endif 601#endif
602
603 display = egetenv ("DISPLAY");
604 }
605
606 if (!display)
607 {
608 display = alt_display;
609 alt_display = NULL;
618 } 610 }
619 611
620 /* A null-string display is invalid. */ 612 /* A null-string display is invalid. */
@@ -1415,10 +1407,37 @@ set_socket (int no_exit_if_error)
1415 exit (EXIT_FAILURE); 1407 exit (EXIT_FAILURE);
1416} 1408}
1417 1409
1418#ifdef WINDOWSNT 1410#ifdef HAVE_NTGUI
1419FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */ 1411FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
1420FARPROC get_wc; /* Pointer to RealGetWindowClassA. */ 1412FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
1421 1413
1414void
1415w32_set_user_model_id (void)
1416{
1417 HMODULE shell;
1418 HRESULT (WINAPI * set_user_model) (wchar_t * id);
1419
1420 /* On Windows 7 and later, we need to set the user model ID
1421 to associate emacsclient launched files with Emacs frames
1422 in the UI. */
1423 shell = LoadLibrary ("shell32.dll");
1424 if (shell)
1425 {
1426 set_user_model
1427 = (void *) GetProcAddress (shell,
1428 "SetCurrentProcessExplicitAppUserModelID");
1429 /* If the function is defined, then we are running on Windows 7
1430 or newer, and the UI uses this to group related windows
1431 together. Since emacs, runemacs, emacsclient are related, we
1432 want them grouped even though the executables are different,
1433 so we need to set a consistent ID between them. */
1434 if (set_user_model)
1435 set_user_model (L"GNU.Emacs");
1436
1437 FreeLibrary (shell);
1438 }
1439}
1440
1422BOOL CALLBACK 1441BOOL CALLBACK
1423w32_find_emacs_process (HWND hWnd, LPARAM lParam) 1442w32_find_emacs_process (HWND hWnd, LPARAM lParam)
1424{ 1443{
@@ -1467,7 +1486,7 @@ w32_give_focus (void)
1467 && (get_wc = GetProcAddress (user32, "RealGetWindowClassA"))) 1486 && (get_wc = GetProcAddress (user32, "RealGetWindowClassA")))
1468 EnumWindows (w32_find_emacs_process, (LPARAM) 0); 1487 EnumWindows (w32_find_emacs_process, (LPARAM) 0);
1469} 1488}
1470#endif 1489#endif /* HAVE_NTGUI */
1471 1490
1472/* Start the emacs daemon and try to connect to it. */ 1491/* Start the emacs daemon and try to connect to it. */
1473 1492
@@ -1537,11 +1556,13 @@ main (int argc, char **argv)
1537 main_argv = argv; 1556 main_argv = argv;
1538 progname = argv[0]; 1557 progname = argv[0];
1539 1558
1540#ifdef WINDOWSNT 1559#ifdef HAVE_NTGUI
1541 /* On Windows 7 and later, we need to explicitly associate emacsclient 1560 /* On Windows 7 and later, we need to explicitly associate
1542 with emacs so the UI behaves sensibly. */ 1561 emacsclient with emacs so the UI behaves sensibly. This
1562 association does no harm if we're not actually connecting to an
1563 Emacs using a window display. */
1543 w32_set_user_model_id (); 1564 w32_set_user_model_id ();
1544#endif 1565#endif /* HAVE_NTGUI */
1545 1566
1546 /* Process options. */ 1567 /* Process options. */
1547 decode_options (argc, argv); 1568 decode_options (argc, argv);
@@ -1577,9 +1598,10 @@ main (int argc, char **argv)
1577 fail (); 1598 fail ();
1578 } 1599 }
1579 1600
1580#ifdef WINDOWSNT 1601#ifdef HAVE_NTGUI
1602 if (display && !strcmp (display, "w32"))
1581 w32_give_focus (); 1603 w32_give_focus ();
1582#endif 1604#endif /* HAVE_NTGUI */
1583 1605
1584 /* Send over our environment and current directory. */ 1606 /* Send over our environment and current directory. */
1585 if (!current_frame) 1607 if (!current_frame)
@@ -1748,46 +1770,56 @@ main (int argc, char **argv)
1748 if (end_p != NULL) 1770 if (end_p != NULL)
1749 *end_p++ = '\0'; 1771 *end_p++ = '\0';
1750 1772
1751 if (strprefix ("-emacs-pid ", p)) 1773 if (strprefix ("-emacs-pid ", p))
1752 { 1774 {
1753 /* -emacs-pid PID: The process id of the Emacs process. */ 1775 /* -emacs-pid PID: The process id of the Emacs process. */
1754 emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10); 1776 emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10);
1755 } 1777 }
1756 else if (strprefix ("-window-system-unsupported ", p)) 1778 else if (strprefix ("-window-system-unsupported ", p))
1757 { 1779 {
1758 /* -window-system-unsupported: Emacs was compiled without X 1780 /* -window-system-unsupported: Emacs was compiled without support
1759 support. Try again on the terminal. */ 1781 for whatever window system we tried. Try the alternate
1760 nowait = 0; 1782 display, or, failing that, try the terminal. */
1761 tty = 1; 1783 if (alt_display)
1762 goto retry; 1784 {
1763 } 1785 display = alt_display;
1764 else if (strprefix ("-print ", p)) 1786 alt_display = NULL;
1765 { 1787 }
1766 /* -print STRING: Print STRING on the terminal. */ 1788 else
1767 str = unquote_argument (p + strlen ("-print ")); 1789 {
1768 if (needlf) 1790 nowait = 0;
1769 printf ("\n"); 1791 tty = 1;
1770 printf ("%s", str); 1792 }
1771 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1793
1772 } 1794 goto retry;
1773 else if (strprefix ("-print-nonl ", p)) 1795 }
1774 { 1796 else if (strprefix ("-print ", p))
1775 /* -print-nonl STRING: Print STRING on the terminal. 1797 {
1776 Used to continue a preceding -print command. */ 1798 /* -print STRING: Print STRING on the terminal. */
1777 str = unquote_argument (p + strlen ("-print-nonl ")); 1799 str = unquote_argument (p + strlen ("-print "));
1778 printf ("%s", str); 1800 if (needlf)
1779 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1801 printf ("\n");
1780 } 1802 printf ("%s", str);
1781 else if (strprefix ("-error ", p)) 1803 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1782 { 1804 }
1783 /* -error DESCRIPTION: Signal an error on the terminal. */ 1805 else if (strprefix ("-print-nonl ", p))
1784 str = unquote_argument (p + strlen ("-error ")); 1806 {
1785 if (needlf) 1807 /* -print-nonl STRING: Print STRING on the terminal.
1786 printf ("\n"); 1808 Used to continue a preceding -print command. */
1787 fprintf (stderr, "*ERROR*: %s", str); 1809 str = unquote_argument (p + strlen ("-print-nonl "));
1788 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1810 printf ("%s", str);
1789 exit_status = EXIT_FAILURE; 1811 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1790 } 1812 }
1813 else if (strprefix ("-error ", p))
1814 {
1815 /* -error DESCRIPTION: Signal an error on the terminal. */
1816 str = unquote_argument (p + strlen ("-error "));
1817 if (needlf)
1818 printf ("\n");
1819 fprintf (stderr, "*ERROR*: %s", str);
1820 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1821 exit_status = EXIT_FAILURE;
1822 }
1791#ifdef SIGSTOP 1823#ifdef SIGSTOP
1792 else if (strprefix ("-suspend ", p)) 1824 else if (strprefix ("-suspend ", p))
1793 { 1825 {
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 411b7057861..b6cd1530a4c 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -58,9 +58,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#undef chdir 58#undef chdir
59#define READ_TEXT "rt" 59#define READ_TEXT "rt"
60#define READ_BINARY "rb" 60#define READ_BINARY "rb"
61#define IS_SLASH(c) ((c) == '/' || (c) == '\\' || (c) == ':')
61#else /* not DOS_NT */ 62#else /* not DOS_NT */
62#define READ_TEXT "r" 63#define READ_TEXT "r"
63#define READ_BINARY "r" 64#define READ_BINARY "r"
65#define IS_SLASH(c) ((c) == '/')
64#endif /* not DOS_NT */ 66#endif /* not DOS_NT */
65 67
66static int scan_file (char *filename); 68static int scan_file (char *filename);
@@ -1025,9 +1027,9 @@ scan_c_file (char *filename, const char *mode)
1025 arglist, but the doc string must still have a backslash and newline 1027 arglist, but the doc string must still have a backslash and newline
1026 immediately after the double quote. 1028 immediately after the double quote.
1027 The only source files that must follow this convention are preloaded 1029 The only source files that must follow this convention are preloaded
1028 uncompiled ones like loaddefs.el and bindings.el; aside 1030 uncompiled ones like loaddefs.el; aside from that, it is always the .elc
1029 from that, it is always the .elc file that we look at, and they are no 1031 file that we should look at, and they are no problem because byte-compiler
1030 problem because byte-compiler output follows this convention. 1032 output follows this convention.
1031 The NAME and DOCSTRING are output. 1033 The NAME and DOCSTRING are output.
1032 NAME is preceded by `F' for a function or `V' for a variable. 1034 NAME is preceded by `F' for a function or `V' for a variable.
1033 An entry is output only if DOCSTRING has \ newline just after the opening ". 1035 An entry is output only if DOCSTRING has \ newline just after the opening ".
@@ -1098,15 +1100,48 @@ search_lisp_doc_at_eol (FILE *infile)
1098 return 1; 1100 return 1;
1099} 1101}
1100 1102
1103#define DEF_ELISP_FILE(fn) { #fn, sizeof(#fn) - 1 }
1104
1101static int 1105static int
1102scan_lisp_file (const char *filename, const char *mode) 1106scan_lisp_file (const char *filename, const char *mode)
1103{ 1107{
1104 FILE *infile; 1108 FILE *infile;
1105 register int c; 1109 register int c;
1106 char *saved_string = 0; 1110 char *saved_string = 0;
1111 /* These are the only files that are loaded uncompiled, and must
1112 follow the conventions of the doc strings expected by this
1113 function. These conventions are automatically followed by the
1114 byte compiler when it produces the .elc files. */
1115 static struct {
1116 const char *fn;
1117 size_t fl;
1118 } const uncompiled[] = {
1119 DEF_ELISP_FILE (loaddefs.el),
1120 DEF_ELISP_FILE (loadup.el),
1121 DEF_ELISP_FILE (charprop.el)
1122 };
1123 int i, match;
1124 size_t flen = strlen (filename);
1107 1125
1108 if (generate_globals) 1126 if (generate_globals)
1109 fatal ("scanning lisp file when -g specified", 0); 1127 fatal ("scanning lisp file when -g specified", 0);
1128 if (flen > 3 && !strcmp (filename + flen - 3, ".el"))
1129 {
1130 for (i = 0, match = 0; i < sizeof (uncompiled) / sizeof (uncompiled[0]);
1131 i++)
1132 {
1133 if (uncompiled[i].fl <= flen
1134 && !strcmp (filename + flen - uncompiled[i].fl, uncompiled[i].fn)
1135 && (flen == uncompiled[i].fl
1136 || IS_SLASH (filename[flen - uncompiled[i].fl - 1])))
1137 {
1138 match = 1;
1139 break;
1140 }
1141 }
1142 if (!match)
1143 fatal ("uncompiled lisp file %s is not supported", filename);
1144 }
1110 1145
1111 infile = fopen (filename, mode); 1146 infile = fopen (filename, mode);
1112 if (infile == NULL) 1147 if (infile == NULL)
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 23ef71de10c..640e8a7c468 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -124,7 +124,7 @@ $(BLD)/profile.exe: $(PROFILEOBJS)
124obj = dosfns.o msdos.o \ 124obj = dosfns.o msdos.o \
125 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ 125 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
126 fontset.o menu.o \ 126 fontset.o menu.o \
127 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ 127 w32.o w32console.o w32fns.o w32heap.o w32inevt.o cygw32.o \
128 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \ 128 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
129 font.o w32font.o w32uniscribe.o \ 129 font.o w32font.o w32uniscribe.o \
130 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \ 130 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
@@ -209,38 +209,38 @@ lisp1= \
209 $(lispsource)emacs-lisp/map-ynp.elc \ 209 $(lispsource)emacs-lisp/map-ynp.elc \
210 $(lispsource)menu-bar.elc \ 210 $(lispsource)menu-bar.elc \
211 $(lispsource)international/mule.elc \ 211 $(lispsource)international/mule.elc \
212 $(lispsource)international/mule-conf.el \ 212 $(lispsource)international/mule-conf.elc \
213 $(lispsource)international/mule-cmds.elc \ 213 $(lispsource)international/mule-cmds.elc \
214 $(lispsource)international/characters.elc \ 214 $(lispsource)international/characters.elc \
215 $(lispsource)international/charprop.el \ 215 $(lispsource)international/charprop.el \
216 $(lispsource)case-table.elc 216 $(lispsource)case-table.elc
217 217
218lisp2 = \ 218lisp2 = \
219 $(lispsource)language/chinese.el \ 219 $(lispsource)language/chinese.elc \
220 $(lispsource)language/cyrillic.el \ 220 $(lispsource)language/cyrillic.elc \
221 $(lispsource)language/indian.el \ 221 $(lispsource)language/indian.elc \
222 $(lispsource)language/sinhala.el \ 222 $(lispsource)language/sinhala.elc \
223 $(lispsource)language/english.el \ 223 $(lispsource)language/english.elc \
224 $(lispsource)language/ethiopic.elc \ 224 $(lispsource)language/ethiopic.elc \
225 $(lispsource)language/european.elc \ 225 $(lispsource)language/european.elc \
226 $(lispsource)language/czech.el \ 226 $(lispsource)language/czech.elc \
227 $(lispsource)language/slovak.el \ 227 $(lispsource)language/slovak.elc \
228 $(lispsource)language/romanian.el \ 228 $(lispsource)language/romanian.elc \
229 $(lispsource)language/greek.el \ 229 $(lispsource)language/greek.elc \
230 $(lispsource)language/hebrew.elc \ 230 $(lispsource)language/hebrew.elc \
231 $(lispsource)language/japanese.el \ 231 $(lispsource)language/japanese.elc \
232 $(lispsource)language/korean.el \ 232 $(lispsource)language/korean.elc \
233 $(lispsource)language/lao.el \ 233 $(lispsource)language/lao.elc \
234 $(lispsource)language/cham.el \ 234 $(lispsource)language/cham.elc \
235 $(lispsource)language/tai-viet.el \ 235 $(lispsource)language/tai-viet.elc \
236 $(lispsource)language/thai.el \ 236 $(lispsource)language/thai.elc \
237 $(lispsource)language/tibetan.elc \ 237 $(lispsource)language/tibetan.elc \
238 $(lispsource)language/vietnamese.el \ 238 $(lispsource)language/vietnamese.elc \
239 $(lispsource)language/misc-lang.el \ 239 $(lispsource)language/misc-lang.elc \
240 $(lispsource)language/utf-8-lang.el \ 240 $(lispsource)language/utf-8-lang.elc \
241 $(lispsource)language/georgian.el \ 241 $(lispsource)language/georgian.elc \
242 $(lispsource)language/khmer.el \ 242 $(lispsource)language/khmer.elc \
243 $(lispsource)language/burmese.el \ 243 $(lispsource)language/burmese.elc \
244 $(lispsource)register.elc \ 244 $(lispsource)register.elc \
245 $(lispsource)replace.elc \ 245 $(lispsource)replace.elc \
246 $(lispsource)simple.elc \ 246 $(lispsource)simple.elc \
@@ -266,7 +266,7 @@ lisp2 = \
266 $(WINDOW_SUPPORT) \ 266 $(WINDOW_SUPPORT) \
267 $(lispsource)widget.elc \ 267 $(lispsource)widget.elc \
268 $(lispsource)window.elc \ 268 $(lispsource)window.elc \
269 $(lispsource)version.el 269 $(lispsource)version.elc
270 270
271# This is needed the first time we build the tree, since temacs.exe 271# This is needed the first time we build the tree, since temacs.exe
272# does not exist yet, and the DOC rule needs it to rebuild DOC whenever 272# does not exist yet, and the DOC rule needs it to rebuild DOC whenever
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