diff --git a/CMakeLists.txt b/CMakeLists.txt index c5b1fd81..ae70cc9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,13 +366,11 @@ if(WIN32) endif() if(MSVC) - # turn off various warnings - # foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996) - # SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}") - # endforeach(warning) + set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /MP") - set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996 /wd4250") if (${MSVC_VERSION} GREATER 1599) + # needed to avoid link errors on multiply-defined standard C++ + # symbols. Suspect this may be an OSG-DB export bug set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" ) endif (${MSVC_VERSION} GREATER 1599) diff --git a/simgear/compiler.h b/simgear/compiler.h index f6bdc37c..ab275061 100644 --- a/simgear/compiler.h +++ b/simgear/compiler.h @@ -61,12 +61,14 @@ // Microsoft compilers. // #ifdef _MSC_VER -# define bcopy(from, to, n) memcpy(to, from, n) +# define strcasecmp stricmp # if _MSC_VER >= 1200 // msvc++ 6.0 up to MSVC2013 # if _MSC_VER < 1900 +# define bcopy(from, to, n) memcpy(to, from, n) # define snprintf _snprintf # define strdup _strdup +# define copysign _copysign # endif # if _MSC_VER < 1800 # define isnan _isnan @@ -74,21 +76,18 @@ # if _MSC_VER < 1500 # define vsnprintf _vsnprintf # endif -# define copysign _copysign -# define strcasecmp stricmp - -# undef min -# undef max # pragma warning(disable: 4786) // identifier was truncated to '255' characters # pragma warning(disable: 4244) // conversion from double to float -# pragma warning(disable: 4305) // truncation from larer type to smaller +# pragma warning(disable: 4305) // truncation from larger type to smaller +# pragma warning(disable: 4267) // conversion from size_t to int / 32-bit type +# pragma warning(disable: 4996) // don't require _ prefix for standard library functions +# pragma warning(disable: 4800) // don't warn about int -> bool performance # else # error What version of MSVC++ is this? # endif - -# define SG_COMPILER_STR "Microsoft Visual C++ version " SG_STRINGIZE(_MSC_VER) +# define SG_COMPILER_STR "Microsoft Visual C++ version " SG_STRINGIZE(_MSC_VER) #endif // _MSC_VER diff --git a/simgear/package/untar.cxx b/simgear/package/untar.cxx index 7698029d..14ba27ce 100644 --- a/simgear/package/untar.cxx +++ b/simgear/package/untar.cxx @@ -278,6 +278,10 @@ TarExtractor::TarExtractor(const SGPath& rootPath) : d->zlibStream.next_out = d->zlibOutput; } +TarExtractor::~TarExtractor() +{ +} + void TarExtractor::extractBytes(const char* bytes, size_t count) { if (d->state >= TarExtractorPrivate::ERROR_STATE) { diff --git a/simgear/package/untar.hxx b/simgear/package/untar.hxx index 76cc1f9d..0b653a67 100644 --- a/simgear/package/untar.hxx +++ b/simgear/package/untar.hxx @@ -34,6 +34,7 @@ class TarExtractor { public: TarExtractor(const SGPath& rootPath); + ~TarExtractor(); void extractBytes(const char* bytes, size_t count);