aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-02-16 15:59:37 +0200
committerEli Zaretskii2013-02-16 15:59:37 +0200
commitcd91fb4b0ae2c05d72adb61bc47c232c2dad015a (patch)
tree76e23eb7e8d05d9a26e66fcb6c16b61e76b381bc
parentf277993be3a50b375c670351cb4051c806edd97f (diff)
downloademacs-cd91fb4b0ae2c05d72adb61bc47c232c2dad015a.tar.gz
emacs-cd91fb4b0ae2c05d72adb61bc47c232c2dad015a.zip
Don't use __STDC__ on MS-Windows unless necessary (Bug #9066).
nt/inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC. src/w32term.c <input_signal_count>: Declare 'volatile' unconditionally.
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/inc/ms-w32.h10
-rw-r--r--src/ChangeLog3
-rw-r--r--src/w32term.c4
4 files changed, 17 insertions, 5 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 18911b90fac..81477e801d6 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12013-02-16 Eli Zaretskii <eliz@gnu.org>
2
3 * inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC.
4 (Bug#9066)
5
12013-02-13 Juanma Barranquero <lekktu@gmail.com> 62013-02-13 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * config.nt: Sync with autogen/config.in. 8 * config.nt: Sync with autogen/config.in.
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index a74c74b4548..5c3caeb38c9 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -265,8 +265,11 @@ struct timespec
265extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); 265extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
266extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); 266extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
267 267
268#ifdef _MSC_VER
268/* This is hacky, but is necessary to avoid warnings about macro 269/* This is hacky, but is necessary to avoid warnings about macro
269 redefinitions using the SDK compilers. */ 270 redefinitions using the MSVC compilers, since, when __STDC__ is
271 undefined or zero, those compilers declare functions like fileno,
272 lseek, and chdir, for which we defined macros above. */
270#ifndef __STDC__ 273#ifndef __STDC__
271#define __STDC__ 1 274#define __STDC__ 1
272#define MUST_UNDEF__STDC__ 275#define MUST_UNDEF__STDC__
@@ -278,6 +281,11 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
278#undef __STDC__ 281#undef __STDC__
279#undef MUST_UNDEF__STDC__ 282#undef MUST_UNDEF__STDC__
280#endif 283#endif
284#else /* !_MSC_VER */
285#include <direct.h>
286#include <io.h>
287#include <stdio.h>
288#endif /* !_MSC_VER */
281 289
282/* Defines that we need that aren't in the standard signal.h. */ 290/* Defines that we need that aren't in the standard signal.h. */
283#define SIGHUP 1 /* Hang up */ 291#define SIGHUP 1 /* Hang up */
diff --git a/src/ChangeLog b/src/ChangeLog
index d326532ecb7..797a02b8f73 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12013-02-16 Eli Zaretskii <eliz@gnu.org> 12013-02-16 Eli Zaretskii <eliz@gnu.org>
2 2
3 * w32term.c <input_signal_count>: Declare 'volatile'
4 unconditionally. (Bug#9066)
5
3 * w32.c (set_errno): Reset h_errno and don't set it to any other 6 * w32.c (set_errno): Reset h_errno and don't set it to any other
4 value. Set errno instead. 7 value. Set errno instead.
5 (check_errno): Reset h_errno. 8 (check_errno): Reset h_errno.
diff --git a/src/w32term.c b/src/w32term.c
index c83ee31d200..170f33ecd67 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -191,11 +191,7 @@ static Time last_mouse_movement_time;
191 191
192/* Incremented by w32_read_socket whenever it really tries to read 192/* Incremented by w32_read_socket whenever it really tries to read
193 events. */ 193 events. */
194#ifdef __STDC__
195static int volatile input_signal_count; 194static int volatile input_signal_count;
196#else
197static int input_signal_count;
198#endif
199 195
200#ifdef CYGWIN 196#ifdef CYGWIN
201int w32_message_fd = -1; 197int w32_message_fd = -1;