You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by pm...@apache.org on 2014/12/17 14:29:21 UTC
[71/92] [abbrv] incubator-corinthia git commit: Win32: Pass compiler
switches from build file
Win32: Pass compiler switches from build file
For cases where we disable certain compiler warnings on Windows, do it
via command-line arguments to the compiler, rather than #pragma
declarations in the source.
The two specific warnings we disable are:
4090 'function': different 'const'
This is disabled to work around false positives, where VC++
correctly interprets the semantics of const in pointrs, confusing
const char ** as something that can't be passed to free(), which we
do a lot (it's actually valid; its the elements of the array that
are const, not the array itself).
4996 // The POSIX name for this item is deprecated
Because VC++ wants you to use _strdup instead of strup, and similar
functions (for some stupid reason)
Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/d44cb512
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/d44cb512
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/d44cb512
Branch: refs/heads/stable
Commit: d44cb5124b2448d322984554fc6aa2f9ee6a1c58
Parents: 0b8b328
Author: Peter Kelly <pe...@uxproductivity.com>
Authored: Mon Dec 8 00:41:07 2014 +0700
Committer: Peter Kelly <pe...@uxproductivity.com>
Committed: Mon Dec 8 00:50:10 2014 +0700
----------------------------------------------------------------------
CMakeLists.txt | 1 +
DocFormats/DFCommon.h | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d44cb512/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e676e8..0b937fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
${PROJECT_SOURCE_DIR}/libs/SDL2/lib/x86
${PROJECT_SOURCE_DIR}/libs/SDL2_image/lib/x86)
set(LIBS ${LIBS} libxml2 zdll iconv SDL2 SDL2_image)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4090 /wd4996")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
add_subdirectory(DocFormats/3rdparty/external/minizip)
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/d44cb512/DocFormats/DFCommon.h
----------------------------------------------------------------------
diff --git a/DocFormats/DFCommon.h b/DocFormats/DFCommon.h
index 06ee6cb..d6cdbd7 100644
--- a/DocFormats/DFCommon.h
+++ b/DocFormats/DFCommon.h
@@ -21,8 +21,6 @@
#define snprintf _snprintf
#define strcasecmp _stricmp
#define bzero(mem,size) memset(mem,0,size)
-#pragma warning(disable: 4090) // 'function': different 'const' qualifiers
-#pragma warning(disable: 4996) // The POSIX name for this item is deprecated
#else // not WIN32
#endif