mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027118: Configuration - do not suppress deprecation warnings when using msvc
Patch removes option -wd4996 from VS project settings (which suppresses old deprecation warnings). Instead, macros _CRT_SECURE_NO_WARNINGS (suppresses 444 warnings) and _CRT_NONSTDC_NO_DEPRECATE (suppresses 17 warnings) have been added. Deprecation warning on GetVersionEx() has been suppressed locally in OSD_Host.cxx. In STEPConstruct_AP203Context.cxx, OSD_Host is used instead of low-level system functions. This eliminates dependency of TKSTEP on winsock32.lib on Windows.
This commit is contained in:
@@ -323,7 +323,7 @@ void OSD_Environment :: Build () {
|
||||
|
||||
str = myName + TEXT( "=" ) + myValue;
|
||||
|
||||
putenv ( str.ToCString () );
|
||||
_putenv (str.ToCString());
|
||||
|
||||
} // end OSD_Environment :: Build
|
||||
|
||||
@@ -333,7 +333,7 @@ void OSD_Environment :: Remove () {
|
||||
|
||||
str = myName + TEXT( "=" );
|
||||
|
||||
putenv ( str.ToCString () );
|
||||
_putenv (str.ToCString());
|
||||
|
||||
} // end OSD_Environment :: Remove
|
||||
|
||||
|
@@ -216,6 +216,10 @@ OSD_Host :: OSD_Host () {
|
||||
ZeroMemory (&ms, sizeof(ms));
|
||||
ZeroMemory ( szHostName, sizeof ( Standard_Character ) * (MAX_COMPUTERNAME_LENGTH + 1) );
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// suppress GetVersionEx() deprecation warning
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
if ( !GetVersionEx ( &osVerInfo ) ) {
|
||||
|
||||
_osd_wnt_set_error ( myError, OSD_WHost );
|
||||
@@ -230,6 +234,9 @@ OSD_Host :: OSD_Host () {
|
||||
GlobalMemoryStatus ( &ms );
|
||||
|
||||
} // end else
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4996)
|
||||
#endif
|
||||
|
||||
if ( !Failed () ) {
|
||||
|
||||
|
Reference in New Issue
Block a user