corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [71/92] [abbrv] incubator-corinthia git commit: Win32: Pass compiler switches from build file
Date Wed, 17 Dec 2014 13:29:21 GMT
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 <peter@uxproductivity.com>
Authored: Mon Dec 8 00:41:07 2014 +0700
Committer: Peter Kelly <peter@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
 


Mime
View raw message