diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake
index efcefe9662..aeda51c2ba 100644
--- a/adm/cmake/occt_defs_flags.cmake
+++ b/adm/cmake/occt_defs_flags.cmake
@@ -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")
diff --git a/adm/templates/template.vc10 b/adm/templates/template.vc10
index f8a60a6fb4..6be03f7c33 100644
--- a/adm/templates/template.vc10
+++ b/adm/templates/template.vc10
@@ -85,7 +85,7 @@
true
MaxSpeed
OnlyExplicitInline
- NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
true
Async
MultiThreadedDLL
@@ -95,7 +95,7 @@
.\..\..\..\win32\__VCVER__\obj\__TKNAM__/
Level4
true
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
Precise__VCMPL32__
@@ -129,7 +129,7 @@
true
Disabled
OnlyExplicitInline
- _DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ _DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
Async
MultiThreadedDebugDLL
.\..\..\..\win32\__VCVER__\objd\__TKNAM__/
@@ -139,7 +139,7 @@
true
ProgramDatabase
Default
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
EnableFastChecks
Precise__VCMPL32__
@@ -174,7 +174,7 @@
true
MaxSpeed
OnlyExplicitInline
- NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
true
Async
MultiThreadedDLL
@@ -184,7 +184,7 @@
.\..\..\..\win64\__VCVER__\obj\__TKNAM__/
Level4
true
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
Precise__VCMPL64__
@@ -218,7 +218,7 @@
true
Disabled
OnlyExplicitInline
- _DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ _DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
Async
MultiThreadedDebugDLL
.\..\..\..\win64\__VCVER__\objd\__TKNAM__/
@@ -228,7 +228,7 @@
true
ProgramDatabase
Default
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
EnableFastChecks
Precise__VCMPL64__
diff --git a/adm/templates/template.vc10x b/adm/templates/template.vc10x
index fab58fff78..cdfd3669b2 100644
--- a/adm/templates/template.vc10x
+++ b/adm/templates/template.vc10x
@@ -85,7 +85,7 @@
true
MaxSpeed
OnlyExplicitInline
- NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
true
Async
MultiThreadedDLL
@@ -95,7 +95,7 @@
.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/
Level4
true
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
Precise__VCMPL32__
@@ -128,7 +128,7 @@
true
Disabled
OnlyExplicitInline
- _DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ _DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
Async
MultiThreadedDebugDLL
.\..\..\..\win32\__VCVER__\objd\__XQTNAM__/
@@ -138,7 +138,7 @@
true
ProgramDatabase
Default
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
EnableFastChecks
Precise__VCMPL32__
@@ -172,7 +172,7 @@
true
MaxSpeed
OnlyExplicitInline
- NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
true
Async
MultiThreadedDLL
@@ -182,7 +182,7 @@
.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/
Level4
true
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
Precise__VCMPL64__
@@ -215,7 +215,7 @@
true
Disabled
OnlyExplicitInline
- _DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
+ _DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)
Async
MultiThreadedDebugDLL
.\..\..\..\win64\__VCVER__\objd\__XQTNAM__/
@@ -225,7 +225,7 @@
true
ProgramDatabase
Default
- 4996;%(DisableSpecificWarnings)
+ %(DisableSpecificWarnings)
EnableFastChecks
Precise__VCMPL64__
diff --git a/adm/templates/template.vc8 b/adm/templates/template.vc8
index 6d6897a9c9..13c0ae9a31 100644
--- a/adm/templates/template.vc8
+++ b/adm/templates/template.vc8
@@ -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"
/>
#include
diff --git a/src/STEPConstruct/STEPConstruct_AP203Context.cxx b/src/STEPConstruct/STEPConstruct_AP203Context.cxx
index 666688945e..54e2ca9066 100644
--- a/src/STEPConstruct/STEPConstruct_AP203Context.cxx
+++ b/src/STEPConstruct/STEPConstruct_AP203Context.cxx
@@ -34,15 +34,7 @@
#include
#include
-#ifndef _WIN32
-# include
-# include
-#else
-# include
-#endif
-
-#include
-
+#include
#include
#include
@@ -68,6 +60,10 @@
#include
#include
+#ifndef _WIN32
+# include
+#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
diff --git a/src/TKSTEP/EXTERNLIB b/src/TKSTEP/EXTERNLIB
index 03d09ccd56..9423bb5afc 100755
--- a/src/TKSTEP/EXTERNLIB
+++ b/src/TKSTEP/EXTERNLIB
@@ -11,4 +11,3 @@ TKG3d
TKGeomBase
TKGeomAlgo
TKXSBase
-CSF_wsock32