]> OCCT Git - occt-copy.git/commitdiff
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 efcefe966268198397ec5e13a0539c0196b69e1d..aeda51c2bad460c4927abbfcdb4cb2ad55065483 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 f8a60a6fb4aaa44809046d519d7c8e0925578852..6be03f7c332129449ad989f3611a6a22c3534d74 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 fab58fff78487c83c0d69915118c2a8da330798d..cdfd3669b2c443dc53e4806e2b511edc8dfc1cff 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 6d6897a9c9a30a7df44abe49a657a1012ddd6be8..13c0ae9a31c84cff621638ce68181ca828f2d545 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 910fa2f3e282eb22f108135601367646972d44c1..4d222d05f280541e250a2a08d34e02ac2d0b1b50 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 3d1dd5d940514253f867e0fd30b9d17c6494107f..a0e135117984f805f655bcee7e20eeaf8ca48c78 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 b98be69059b7e427572a4599d3b9d0dfd54ebbd0..d10f06638446717b1bf08822470670d7486098e1 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 fdc9638f20b62db7ec63d9af7440d9763e0eeb22..b111f778de2198a53fcd1e24167e22848d20c727 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 fbba8342d4978903704b0f00ebea6530ec4227a2..60c88ee7aff1f739c60066add7c1b75700e0a8af 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 9459e13d333e4d9348bebbdb5f4858adfc8f78e7..d467f1fb5f39afb7a75b569e4f89d43f9609eda8 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 666688945e4e506403f20ba914c4a774479fdfa5..54e2ca9066c4635e4178eb3f3e2ce566bed19933 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 03d09ccd56a38bd6c358f3d2e558f6739ebfe03b..9423bb5afc046f6ca4867c1359d07ed2dab1d234 100755 (executable)
@@ -11,4 +11,3 @@ TKG3d
 TKGeomBase
 TKGeomAlgo
 TKXSBase
-CSF_wsock32