From: <sv...@ww...> - 2004-11-15 21:34:39
|
Author: delta Date: 2004-11-15 13:34:31 -0800 (Mon, 15 Nov 2004) New Revision: 1321 Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h trunk/CSP/SimData/Include/SimData/HashUtility.h trunk/CSP/SimData/Include/SimData/Math.h trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: * Replaced every WIN32 by _WIN32 (windows native). Removed WIN32 definition in the preprocessor (vcproj). * Added a function object nohash64 (hashing function) for the vc7.x compilers' STL std/stdext::hash_map non standard container (must inheritate from std/stdext::hash_compare). * Updated vcproj. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1321 Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h =================================================================== --- trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-11-14 23:12:59 UTC (rev 1320) +++ trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-11-15 21:34:31 UTC (rev 1321) @@ -36,7 +36,7 @@ #include <SimData/Properties.h> -#if defined(WIN32) +#if defined(_WIN32) # define WIN_ATOMIC # define _WINSOCKAPI_ # define NOMINMAX Modified: trunk/CSP/SimData/Include/SimData/HashUtility.h =================================================================== --- trunk/CSP/SimData/Include/SimData/HashUtility.h 2004-11-14 23:12:59 UTC (rev 1320) +++ trunk/CSP/SimData/Include/SimData/HashUtility.h 2004-11-15 21:34:31 UTC (rev 1321) @@ -167,10 +167,22 @@ /** Pass through (nop) hash function for 64-bit hash keys. */ -struct nohash64 { +#if defined(_MSC_VER) && (_MSC_VER >= 1300) + struct nohash64: public HASH<const uint64> { + size_t operator ()(const uint64& x) const { + return static_cast<size_t>(x); + } + bool operator()(const uint64& x1, const uint64& x2) const { + return (x1 < x2); + } + }; +#else + struct nohash64 { inline size_t operator()(uint64 x) const { return static_cast<size_t>(x); } }; +#endif + /** Pass through (nop) hash function for 32-bit hash keys. */ struct nohash32 { Modified: trunk/CSP/SimData/Include/SimData/Math.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Math.h 2004-11-14 23:12:59 UTC (rev 1320) +++ trunk/CSP/SimData/Include/SimData/Math.h 2004-11-15 21:34:31 UTC (rev 1321) @@ -107,13 +107,13 @@ inline void swap(T &a, T &b) { T t = a; a = b; b = t; } -#if (defined(WIN32) && !(defined(_MSC_VER) && (_MSC_VER >= 1300)) && !defined(__MINGW32__) ) || defined (sun) +#if (defined(_WIN32) && !(defined(_MSC_VER) && (_MSC_VER >= 1300)) && !defined(__MINGW32__) ) || defined (sun) #ifndef isnanf #define isnanf (float)isnan #endif #endif -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__) +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__) inline bool isNaN(float v) { return _isnan(v)!=0; } inline bool isNaN(double v) { return _isnan(v)!=0; } #else Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-11-14 23:12:59 UTC (rev 1320) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-11-15 21:34:31 UTC (rev 1321) @@ -30,7 +30,7 @@ OptimizeForProcessor="0" OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories="../Include,$(PYTHON_PATH)/include" - PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;SIMDATA_EXPORTS" + PreprocessorDefinitions="NDEBUG;_USRDLL;SIMDATA_EXPORTS" StringPooling="TRUE" RuntimeLibrary="2" BufferSecurityCheck="FALSE" @@ -109,7 +109,7 @@ Optimization="0" EnableIntrinsicFunctions="TRUE" AdditionalIncludeDirectories="../Include,$(PYTHON_PATH)/include" - PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;SIMDATA_EXPORTS" + PreprocessorDefinitions="_DEBUG;_USRDLL;SIMDATA_EXPORTS" BasicRuntimeChecks="3" RuntimeLibrary="3" RuntimeTypeInfo="TRUE" |