From: Eli Zaretskii Date: Sat, 17 Nov 2012 18:51:06 +0000 (+0200) Subject: Fix bug #12878 with compilation failure with Visual C++ 11.0. X-Git-Tag: emacs-24.2.90~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d8715cdf90538fa8abd3e2c23ed2efd23c4253c1;p=emacs.git Fix bug #12878 with compilation failure with Visual C++ 11.0. src/w32select.c: Include w32common.h before w32term.h, so that windows.h gets included before w32term.h uses some of its features, see below. src/w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New typedefs. (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New prototypes. (EnumSystemLocales) [_MSC_VER]: Define if undefined. --- diff --git a/src/ChangeLog b/src/ChangeLog index d88e43b2b7f..c12eff19ddd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2012-11-17 Eli Zaretskii + + * w32select.c: Include w32common.h before w32term.h, so that + windows.h gets included before w32term.h uses some of its + features, see below. + + * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New + typedefs. + (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New + prototypes. + (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878) + 2012-11-17 Jan Djärv * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834). diff --git a/src/w32select.c b/src/w32select.c index 1b10c74cfe9..6a2a840f914 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -74,8 +74,8 @@ along with GNU Emacs. If not, see . */ #include #include "lisp.h" -#include "w32term.h" /* for all of the w32 includes */ #include "w32common.h" /* os_subtype */ +#include "w32term.h" /* for all of the w32 includes */ #include "keyboard.h" #include "blockinput.h" #include "charset.h" diff --git a/src/w32term.h b/src/w32term.h index af5b37a1171..6e30d374c82 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -752,6 +752,21 @@ extern int w32_system_caret_height; extern int w32_system_caret_x; extern int w32_system_caret_y; +#ifdef _MSC_VER +#ifndef EnumSystemLocales +/* MSVC headers define these only for _WIN32_WINNT >= 0x0500. */ +typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR); +typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR); +BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD); +BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD) +#ifdef UNICODE +#define EnumSystemLocales EnumSystemLocalesW +#else +#define EnumSystemLocales EnumSystemLocalesA +#endif +#endif +#endif + #if EMACSDEBUG extern const char* w32_name_of_message (UINT msg);