msvc_recommended_pragmas.h: Treat C4819 warnings as errors

Warning C4819 in Visual Studio builds indicates an issue of Visual Studio
2005 and later running on East Asian locales of Windows, which likely
results in broken builds of GLib, Pango, GTK+, and possibly other GNOME
projects such as Cogl and Clutter (and is also an issue when building other
projects like QT and Firefox).

Treat this warning as an error as a result when building GLib-based items
on Visual Studio, and tell people how to remedy this issue correctly.
This commit is contained in:
Chun-wei Fan 2013-11-25 15:26:25 +08:00
parent 3d70db0750
commit 0dbe5c43df
2 changed files with 17 additions and 0 deletions

View File

@ -67,6 +67,20 @@ you would be allowed by the license to distrubute a GLib linked to
msvcr70.dll or msvcr80.dll, as those are not part of the operating
system, but of the MSVC product. msvcrt.dll is part of Windows.
For people using Visual Studio 2005 or later:
If you are building GLib-based libraries or applications, or GLib itself
and you see a C4819 error (or warning, before C4819 is treated as an error
in msvc_recommended_pragmas.h), please be advised that this error/warning should
not be disregarded, as this likely means portions of the build is not being
done correctly, as this is an issue of Visual Studio running on CJK (East Asian)
locales. This is an issue that also affects builds of other projects, such as
QT, Firefox, LibreOffice/OpenOffice, Pango and GTK+, along with many other projects.
To overcome this problem, please set your system's locale setting for non-Unicode to
English (United States), reboot, and restart the build, and the code should build
normally. See also this GNOME Wiki page [1] that gives a bit further info on this.
Building software that use GLib or GTK+
=======================================
@ -367,3 +381,4 @@ dependencies order.
+- plug-ins
+- python
[1]: https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack under "Preparations"

View File

@ -27,6 +27,8 @@
#pragma warning(disable:4244) /* No possible loss of data warnings */
#pragma warning(disable:4305) /* No truncation from int to char warnings */
#pragma warning(error:4819) /* The file contains a character that cannot be represented in the current code page */
/* work around Microsoft's premature attempt to deprecate the C-Library */
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS