]> code.delx.au - gnu-emacs/commitdiff
Don't use __STDC__ on MS-Windows unless necessary (Bug #9066).
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2013 13:59:37 +0000 (15:59 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2013 13:59:37 +0000 (15:59 +0200)
 nt/inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC.

 src/w32term.c <input_signal_count>: Declare 'volatile' unconditionally.

nt/ChangeLog
nt/inc/ms-w32.h
src/ChangeLog
src/w32term.c

index 18911b90faccdf6ae322d421fe8aa753d0953a27..81477e801d6710521fa37fda127ff34246e462ed 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC.
+       (Bug#9066)
+
 2013-02-13  Juanma Barranquero  <lekktu@gmail.com>
 
        * config.nt: Sync with autogen/config.in.
index a74c74b4548f7c214187425d74783451c64fdac9..5c3caeb38c9151fadbb327534a0a61fd2afe65e1 100644 (file)
@@ -265,8 +265,11 @@ struct timespec
 extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
 extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
 
+#ifdef _MSC_VER
 /* This is hacky, but is necessary to avoid warnings about macro
-   redefinitions using the SDK compilers.  */
+   redefinitions using the MSVC compilers, since, when __STDC__ is
+   undefined or zero, those compilers declare functions like fileno,
+   lseek, and chdir, for which we defined macros above.  */
 #ifndef __STDC__
 #define __STDC__ 1
 #define MUST_UNDEF__STDC__
@@ -278,6 +281,11 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
 #undef __STDC__
 #undef MUST_UNDEF__STDC__
 #endif
+#else  /* !_MSC_VER */
+#include <direct.h>
+#include <io.h>
+#include <stdio.h>
+#endif /* !_MSC_VER */
 
 /* Defines that we need that aren't in the standard signal.h.  */
 #define SIGHUP  1               /* Hang up */
index d326532ecb7cbea9c71cd5f31be9853f61e99903..797a02b8f736e11948c9daba6838c2fa8f57a401 100644 (file)
@@ -1,5 +1,8 @@
 2013-02-16  Eli Zaretskii  <eliz@gnu.org>
 
+       * w32term.c <input_signal_count>: Declare 'volatile'
+       unconditionally.  (Bug#9066)
+
        * w32.c (set_errno): Reset h_errno and don't set it to any other
        value.  Set errno instead.
        (check_errno): Reset h_errno.
index c83ee31d2005d49d7be1f5c68aec4c36b499cf14..170f33ecd67917a78e57a2ab97510f276c2d3b26 100644 (file)
@@ -191,11 +191,7 @@ static Time last_mouse_movement_time;
 
 /* Incremented by w32_read_socket whenever it really tries to read
    events.  */
-#ifdef __STDC__
 static int volatile input_signal_count;
-#else
-static int input_signal_count;
-#endif
 
 #ifdef CYGWIN
 int w32_message_fd = -1;