[glib] msvc_recommended_pragmas.h: Treat C4819 warnings as errors



commit 0dbe5c43df6d3eb32abe766ed08da525a8c8bfa4
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Nov 25 15:26:25 2013 +0800

    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.

 README.win32               |   15 +++++++++++++++
 msvc_recommended_pragmas.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/README.win32 b/README.win32
index 520cbdb..3ef45c5 100644
--- a/README.win32
+++ b/README.win32
@@ -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"
diff --git a/msvc_recommended_pragmas.h b/msvc_recommended_pragmas.h
index f78f9a1..c0eb1d5 100644
--- a/msvc_recommended_pragmas.h
+++ b/msvc_recommended_pragmas.h
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]