From 8a0c01dd25dabf60ace651c7acfa1a5e326458e8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 24 Mar 2012 15:43:21 +0200 Subject: [PATCH] Fix bug #9960 with MSVC build on MS-Windows. src/s/ms-w32.h (tzname): Include time.h before redirecting to _tzname. Fixes the MSVC build. --- src/ChangeLog | 5 +++++ src/s/ms-w32.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 182493abe67..9a4d10d410e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-03-24 Eli Zaretskii + + * s/ms-w32.h (tzname): Include time.h before redirecting to + _tzname. Fixes the MSVC build. (Bug#9960) + 2012-03-24 Andreas Schwab * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6 diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index d533ae34ac3..5eed3a177dc 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -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 #define tzname _tzname #if !defined (_MSC_VER) || (_MSC_VER < 1400) #undef utime -- 2.39.2