Re: [pcre-dev] [PATCH] Quash deprecation warnings on Windows

Page principale
Supprimer ce message
Auteur: Daniel Richard G
Date:  
À: Graycode
CC: pcre-dev
Sujet: Re: [pcre-dev] [PATCH] Quash deprecation warnings on Windows
On Thu, 6 Dec 2012, Graycode wrote:

> Yet the CMakeLists.txt file currently contains:
>
> IF(MSVC)
>        ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
> ENDIF(MSVC)

>
> I'm not a Cmake user, but that seems a more appropriate place for
> settings that are unique to a particular compiler brand and version.


Ah, good catch! I missed that bit.

New patch attached.


--Daniel


--
Daniel Richard G. || danielg@??? || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/Index: config-cmake.h.in
===================================================================
--- config-cmake.h.in    (revision 1229)
+++ config-cmake.h.in    (working copy)
@@ -51,8 +51,4 @@
 #define MAX_NAME_SIZE    32
 #define MAX_NAME_COUNT    10000
 
-#ifdef _MSC_VER
-#define _CRT_SECURE_NO_WARNINGS 1
-#endif
-
 /* end config.h for CMake builds */
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt    (revision 1229)
+++ CMakeLists.txt    (working copy)
@@ -570,7 +570,7 @@
 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
 
 IF(MSVC)
-        ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
+        ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
 ENDIF(MSVC)
 
 SET(CMAKE_INCLUDE_CURRENT_DIR 1)