]> code.delx.au - gnu-emacs/commitdiff
Fix bug #9960 with MSVC build on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Sat, 24 Mar 2012 13:43:21 +0000 (15:43 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 24 Mar 2012 13:43:21 +0000 (15:43 +0200)
 src/s/ms-w32.h (tzname): Include time.h before redirecting to
 _tzname.  Fixes the MSVC build.

src/ChangeLog
src/s/ms-w32.h

index 182493abe676241f7831221d456872c1c7536428..9a4d10d410e23fc905c2a63722581832660e62dc 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-24  Eli Zaretskii  <eliz@gnu.org>
+
+       * s/ms-w32.h (tzname): Include time.h before redirecting to
+       _tzname.  Fixes the MSVC build.  (Bug#9960)
+
 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
 
        * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
index d533ae34ac3875dfcc8ac1b55bb341808174beb9..5eed3a177dcfe57028c28e4e42ddfe5d9e34d42a 100644 (file)
@@ -286,6 +286,12 @@ typedef int pid_t;
 #define stricmp   _stricmp
 #define tzset     _tzset
 
+/* Include time.h before redirecting tzname, since MSVC's time.h
+   defines _tzname to call a function, but also declares tzname a
+   2-element array.  Having the redirection before including the
+   header thus has the effect of declaring a function that returns an
+   array, and triggers an error message.  */
+#include <time.h>
 #define tzname    _tzname
 #if !defined (_MSC_VER) || (_MSC_VER < 1400)
 #undef  utime