Subject: bug#12878: 24.2; Compiling failed on Windows 7 with VC 11 Express: _WIN32_WINNT version too low

From: Eli Zaretskii <[email-masked]>
Date: Sat, 17 Nov 2012 20:57:26 +0200

> Date: Wed, 14 Nov 2012 09:14:45 +0800
> From: 李丁 <[email-masked]>
> Cc: [email-masked]
> 
> Sure, adding a correct prototype is just like including the correct
> header file if Windows 9X really supports this function. But you
> should be careful checking compiler versions, in case that
> redefinition error occur.

I added the prototype of EnumSystemLocales to one of the w32 headers.
Please try the latest emacs-24 branch (revision 110902 or later) and
see if you still have problems building it.

> Actually, I encountered several redefinition problems during compilation.
> For example in w32term.c:
> 
>     #ifndef GLYPHSET
>     /* Pre Windows 2000, this was not available, but define it here so
>        that Emacs compiled on such a platform will run on newer versions.
>  */
>     ...
>     #endif
> 
> VC 11.0 does not define GLYPHSET either (or not included), but it does have
> the definitions,
> and above code leads to redefinition error.

This is no longer in the development sources of the emacs-24 branch.
This code fragment is now guarded by "#if _WIN32_WINNT < 0x0500",
which I think should work for you, as long as you don't define
_WIN32_WINNT to a value higher than 0x0400.

> And this in w32term.c too:
> 
>     /* Reportedly, MSVC does not have this in its headers.  */
>     #ifdef _MSC_VER
>     DECLARE_HANDLE(HMONITOR);
>     #endif
> 
> VC 11.0 does have HMONITOR, and another redefinition error.

This is now guarded by "#if defined (_MSC_VER) && _WIN32_WINNT < 0x0500"
so again, I don't think that it should give you trouble with
_WIN32_WINNT set at 0x0400.

Please try the latest emacs-24 branch, and if it works for you, I will
close the bug.