From: <sv...@ww...> - 2004-10-03 13:42:34
|
Author: delta Date: 2004-10-03 06:41:08 -0700 (Sun, 03 Oct 2004) New Revision: 1275 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/AtomicCounter.h trunk/CSP/SimData/Include/SimData/Enum.h trunk/CSP/SimData/Include/SimData/FileUtility.h trunk/CSP/SimData/Source/FileUtility.cpp trunk/CSP/SimData/Source/LogStream.cpp trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: * Updated vcproj. * Exported EnumerationCore from Enum.h. * Used Interlocked* instead of _Interlocked* in AtomicCounter.h. * Removed ospath namespace in front of stripFileExtension. * Added #define NOMINMAX in FileUtility.cpp to avoid usual conflicts including windows.h. * Changed "contents" into "entries" in getDirectoryContents (_WIN32) from FileUtility.cpp. Changed FileClosed into FindClose. * Exported _log_reference_count_error & _log_reference_conversion_error from LogStream.cpp. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1275 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/CHANGES.current 2004-10-03 13:41:08 UTC (rev 1275) @@ -1,6 +1,24 @@ Version 0.4.0 (in progress) =========================== +2004-04-03: delta + * Updated vcproj. + + * Exported EnumerationCore from Enum.h. + + * Used Interlocked* instead of _Interlocked* in AtomicCounter.h. + + * Removed ospath namespace in front of stripFileExtension. + + * Added #define NOMINMAX in FileUtility.cpp to avoid usual conflicts + including windows.h. + + * Changed "contents" into "entries" in getDirectoryContents (_WIN32) from + FileUtility.cpp. Changed FileClosed into FindClose. + + * Exported _log_reference_count_error & _log_reference_conversion_error from + LogStream.cpp. + 2004-10-02: onsight * Implement AtomicCounter using compiler intrinsics under msvc. @@ -40,7 +58,7 @@ 2004-09-28: delta * Added a #undef ERROR after inlcuding windows.h, protected behind - a #ifdef. + a #ifdef in AtomicCounter.h. 2004-09-26: onsight * Fix a couple compiler warnings under msvc. Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h =================================================================== --- trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-10-03 13:41:08 UTC (rev 1275) @@ -38,10 +38,10 @@ #if defined(WIN32) # define WIN_ATOMIC -//# define _WINSOCKAPI_ -//# define NOMINMAX -//# include <Windows.h> -//# undef ERROR +# define _WINSOCKAPI_ +# define NOMINMAX +# include <Windows.h> +# undef ERROR #else # define LIN_ATOMIC extern "C" { @@ -63,14 +63,14 @@ // Atomic counter using windows-specific atomic counter primitives (much // faster than mutex locking). #elif defined(WIN_ATOMIC) -# define SIMDATA_ATOMIC_SET(x, count) _InterlockedExchange(&x, count) -# define SIMDATA_ATOMIC_DEC(x) _InterlockedDecrement(&x) ? false : true; -# define SIMDATA_ATOMIC_INC(x) _InterlockedIncrement(&x) ? false : true; +# define SIMDATA_ATOMIC_SET(x, count) InterlockedExchange(&x, count) +# define SIMDATA_ATOMIC_DEC(x) InterlockedDecrement(&x) ? false : true; +# define SIMDATA_ATOMIC_INC(x) InterlockedIncrement(&x) ? false : true; # define SIMDATA_ATOMIC_GET(x) x # define SIMDATA_ATOMIC_TYPE volatile LONG -# pragma intrinsic (_InterlockedExchange) -# pragma intrinsic (_InterlockedDecrement) -# pragma intrinsic (_InterlockedIncrement) +//# pragma intrinsic (_InterlockedExchange) +//# pragma intrinsic (_InterlockedDecrement) +//# pragma intrinsic (_InterlockedIncrement) // Atomic counter using pthreads locking (slow but safe). #else NAMESPACE_SIMDATA Modified: trunk/CSP/SimData/Include/SimData/Enum.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Enum.h 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/Include/SimData/Enum.h 2004-10-03 13:41:08 UTC (rev 1275) @@ -119,7 +119,7 @@ * You should never create an instance of this class directly; * use Enumeration instead. */ -class EnumerationCore: public Referenced { +class SIMDATA_EXPORT EnumerationCore: public Referenced { friend class Enumeration; typedef std::pair<std::string, int> Element; typedef std::vector<Element> Elements; Modified: trunk/CSP/SimData/Include/SimData/FileUtility.h =================================================================== --- trunk/CSP/SimData/Include/SimData/FileUtility.h 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/Include/SimData/FileUtility.h 2004-10-03 13:41:08 UTC (rev 1275) @@ -142,7 +142,7 @@ /** Removes the last extension from a filepath. Returns the extension * (excluding the '.'), or an empty string if no extensions were found. */ - extern SIMDATA_EXPORT std::string ospath::stripFileExtension(std::string &path); + extern SIMDATA_EXPORT std::string stripFileExtension(std::string &path); /** Get the last extension of a filename (excluding the '.'), or an empty * string if no extensions were found. Modified: trunk/CSP/SimData/Source/FileUtility.cpp =================================================================== --- trunk/CSP/SimData/Source/FileUtility.cpp 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/Source/FileUtility.cpp 2004-10-03 13:41:08 UTC (rev 1275) @@ -34,6 +34,7 @@ #ifdef _WIN32 # define STRICT /* Strict typing, please */ +# define NOMINMAX # include <windows.h> # include <direct.h> # include <ctype.h> @@ -197,7 +198,7 @@ #else // POSIX (hopefully) static const int mode = F_OK; #endif - return access(path.c_str(), mode); + return access(path.c_str(), mode) != 0; } ospath::DirectoryContents ospath::getDirectoryContents(std::string const &path) { @@ -208,9 +209,9 @@ HANDLE handle = FindFirstFile(search_path.c_str(), &ffd); if (handle != INVALID_HANDLE_VALUE) { do { - contents.push_back(ffd.cFileName); + entries.push_back(ffd.cFileName); } while (FindNextFile(handle, &ffd) != 0); - FileClose(handle); + FindClose(handle); } #else // POSIX (hopefully) DIR *dir = opendir(path.c_str()); Modified: trunk/CSP/SimData/Source/LogStream.cpp =================================================================== --- trunk/CSP/SimData/Source/LogStream.cpp 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/Source/LogStream.cpp 2004-10-03 13:41:08 UTC (rev 1275) @@ -127,12 +127,12 @@ } // not really the right place for this, but convenient. -void _log_reference_count_error(int count, int pointer) { +void SIMDATA_EXPORT _log_reference_count_error(int count, int pointer) { SIMDATA_LOG(LOG_ALL, LOG_ERROR, "simdata::ReferencedBase(" << std::hex << pointer << ") deleted with non-zero reference count (" << count << "): memory corruption possible."); } // not really the right place for this, but convenient. -void _log_reference_conversion_error() { +void SIMDATA_EXPORT _log_reference_conversion_error() { SIMDATA_LOG(LOG_ALL, LOG_ERROR, "simdata::Ref() assignment: incompatible types (dynamic cast failed)."); } Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-10-03 02:29:06 UTC (rev 1274) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2004-10-03 13:41:08 UTC (rev 1275) @@ -106,6 +106,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" + EnableIntrinsicFunctions="TRUE" AdditionalIncludeDirectories="../Include,$(PYTHON_PATH)/include" PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;SIMDATA_EXPORTS" BasicRuntimeChecks="3" @@ -119,7 +120,8 @@ WarningLevel="4" SuppressStartupBanner="TRUE" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="2" + DisableSpecificWarnings="4511;4512;4100"/> <Tool Name="VCCustomBuildTool"/> <Tool @@ -255,12 +257,21 @@ RelativePath="..\Source\Real.cpp"> </File> <File + RelativePath="..\Source\TaggedRecordRegistry.cpp"> + </File> + <File RelativePath="..\Source\ThreadBase.cpp"> </File> <File + RelativePath="..\Source\ThreadLog.cpp"> + </File> + <File RelativePath="..\Source\Timing.cpp"> </File> <File + RelativePath="..\Source\Trace.cpp"> + </File> + <File RelativePath="..\Source\TypeAdapter.cpp"> </File> <File @@ -439,6 +450,9 @@ RelativePath="..\Include\SimData\Vector3.h"> </File> <File + RelativePath="..\Include\SimData\Verify.h"> + </File> + <File RelativePath="..\Include\SimData\Version.h"> </File> </Filter> |