0027118: Configuration - do not suppress deprecation warnings when using msvc
authorkgv <kgv@opencascade.com>
Sat, 30 Jan 2016 12:51:35 +0000 (15:51 +0300)
committerabv <abv@opencascade.com>
Sat, 20 Feb 2016 07:10:10 +0000 (10:10 +0300)
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.

12 files changed:
adm/cmake/occt_defs_flags.cmake
adm/templates/template.vc10
adm/templates/template.vc10x
adm/templates/template.vc8
adm/templates/template.vc8x
adm/templates/template.vc9
adm/templates/template.vc9x
src/OSD/OSD_Environment.cxx
src/OSD/OSD_Host.cxx
src/QANCollection/QANCollection_Stl.cxx
src/STEPConstruct/STEPConstruct_AP203Context.cxx
src/TKSTEP/EXTERNLIB

index efcefe9..aeda51c 100644 (file)
@@ -20,8 +20,7 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
 endif()
 
 if (WIN32)
-  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4996")
-  set (CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -wd4996")
+  add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
 else()
   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
   set (CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -fexceptions -fPIC")
index f8a60a6..6be03f7 100644 (file)
@@ -85,7 +85,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -95,7 +95,7 @@
       <ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
       <WarningLevel>Level4</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
     </ClCompile>
     <ResourceCompile>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
     </ClCompile>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
       <WarningLevel>Level4</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
     </ClCompile>
     <ResourceCompile>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
     </ClCompile>
index fab58ff..cdfd366 100644 (file)
@@ -85,7 +85,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -95,7 +95,7 @@
       <ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
       <WarningLevel>Level4</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
     </ClCompile>
     <ResourceCompile>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
     </ClCompile>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
       <WarningLevel>Level4</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
     </ClCompile>
     <ResourceCompile>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <CompileAs>Default</CompileAs>
-      <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
     </ClCompile>
index 6d6897a..13c0ae9 100644 (file)
@@ -50,7 +50,7 @@
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
@@ -62,7 +62,6 @@
                                ProgramDataBaseFileName=".\..\..\..\win32\vc8\obj\__TKNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                                EnableEnhancedInstructionSet="2"
                        />
                        <Tool
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="3"
                                CompileAs="0"
-                               DisableSpecificWarnings="4996"
                                EnableEnhancedInstructionSet="2"
                        />
                        <Tool
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
                                ProgramDataBaseFileName=".\..\..\..\win64\vc8\obj\__TKNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="3"
                                CompileAs="0"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
index 910fa2f..4d222d0 100644 (file)
@@ -49,7 +49,7 @@
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__;"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -60,7 +60,6 @@
                                WarningLevel="4"
                                SuppressStartupBanner="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4996"
                                EnableEnhancedInstructionSet="2"
                        />
                        <Tool
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
                                ProgramDataBaseFileName=".\..\..\..\win32\vc8\obj\__XQTNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                                EnableEnhancedInstructionSet="2"
                        />
                        <Tool
                                AdditionalOptions="/favor:blend"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
                                ProgramDataBaseFileName=".\..\..\..\win64\vc8\obj\__XQTNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
index 3d1dd5d..a0e1351 100644 (file)
@@ -52,7 +52,7 @@
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
@@ -65,7 +65,6 @@
                                ProgramDataBaseFileName=".\..\..\..\win32\vc9\obj\__TKNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="3"
                                CompileAs="0"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
                                ProgramDataBaseFileName=".\..\..\..\win64\vc9\obj\__TKNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="3"
                                CompileAs="0"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
index b98be69..d10f066 100644 (file)
@@ -52,7 +52,7 @@
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
@@ -64,7 +64,6 @@
                                ProgramDataBaseFileName=".\..\..\..\win32\vc9\obj\__XQTNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalOptions="-MP"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
-                               PreprocessorDefinitions="NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                StringPooling="true"
                                ExceptionHandling="2"
                                RuntimeLibrary="2"
                                ProgramDataBaseFileName=".\..\..\..\win64\vc9\obj\__XQTNAM__/"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                                AdditionalOptions="-MP -favor:blend"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
-                               PreprocessorDefinitions="_DEBUG;$(CSF_DEFINES)__TKDEFS__"
+                               PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__"
                                ExceptionHandling="2"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                WarningLevel="4"
                                SuppressStartupBanner="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4996"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
index fdc9638..b111f77 100644 (file)
@@ -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
 
index fbba834..60c88ee 100644 (file)
@@ -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 ()  ) {
   
index 9459e13..d467f1f 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#if defined(_MSC_VER)
+  // supress "std::Equal1" warning suggesting using msvc "Checked Iterators"
+  #define _SCL_SECURE_NO_WARNINGS
+#endif
+
 #include <QANCollection.hxx>
 #include <Draw_Interpretor.hxx>
 
index 6666889..54e2ca9 100644 (file)
 #include <StepRepr_NextAssemblyUsageOccurrence.hxx>
 #include <StepShape_ShapeDefinitionRepresentation.hxx>
 
-#ifndef _WIN32
-# include <pwd.h>
-# include <netdb.h>
-#else
-# include <winsock2.h>
-#endif
-
-#include <stdio.h>
-
+#include <OSD_Host.hxx>
 #include <OSD_Process.hxx>
 #include <Quantity_Date.hxx>
 
 #include <StepAP203_HArray1OfApprovedItem.hxx>
 #include <StepBasic_ProductCategory.hxx>
 
+#ifndef _WIN32
+# include <pwd.h>
+#endif
+
 //=======================================================================
 //function : STEPConstruct_AP203Context
 //purpose  : 
@@ -164,25 +160,15 @@ Handle(StepBasic_PersonAndOrganization) STEPConstruct_AP203Context::DefaultPerso
 {
   if ( defPersonAndOrganization.IsNull() ) {
     // get IP address as a unique id of organization
-#ifdef _WIN32 // adapted for NT which lacks gethostent()
-    char hostname[1024];
-    hostname[0] = '\0';
-    gethostname ( hostname, 1020 );
-    hostname[1020] = '\0';
-    struct hostent *he = gethostbyname ( hostname );
-#else // adapted for Sun2.5, which lacks definition of gethostname()
-    struct hostent *he = gethostent();
-    while ( he && he->h_name && (unsigned char)he->h_addr_list[0][0] == 127 )
-      he = gethostent();
-#endif
-    Handle(TCollection_HAsciiString) orgId = new TCollection_HAsciiString ( "" );
-    if ( he && he->h_addr_list && he->h_length >0 ) {
-      char str[100];
-      unsigned i1 = (unsigned char)he->h_addr_list[0][0];
-      unsigned i2 = (unsigned char)he->h_addr_list[0][1];
-      unsigned i3 = (unsigned char)he->h_addr_list[0][2];
-      sprintf ( str, "IP%03u.%03u.%03u.000", i1, i2, i3 );
-      orgId->AssignCat ( str );
+    Handle(TCollection_HAsciiString) orgId = new TCollection_HAsciiString ( "IP" );
+    OSD_Host aHost;
+    TCollection_AsciiString anIP = aHost.InternetAddress();
+    // cut off last number
+    Standard_Integer aLastDotIndex = anIP.SearchFromEnd (".");
+    if (aLastDotIndex >0)
+    {
+      anIP.Trunc (aLastDotIndex - 1);
+      orgId->AssignCat (anIP.ToCString());
     }
     
     // create organization
index 03d09cc..9423bb5 100755 (executable)
@@ -11,4 +11,3 @@ TKG3d
 TKGeomBase
 TKGeomAlgo
 TKXSBase
-CSF_wsock32