VS215 tweaks, warning fixes

This commit is contained in:
James Turner 2016-06-09 20:37:54 +01:00
parent d0e31c5cf5
commit 516d76d41b
4 changed files with 16 additions and 14 deletions

View File

@ -366,13 +366,11 @@ if(WIN32)
endif() endif()
if(MSVC) if(MSVC)
# turn off various warnings set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /MP")
# 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 /wd4996 /wd4250")
if (${MSVC_VERSION} GREATER 1599) 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" ) set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
endif (${MSVC_VERSION} GREATER 1599) endif (${MSVC_VERSION} GREATER 1599)

View File

@ -61,12 +61,14 @@
// Microsoft compilers. // Microsoft compilers.
// //
#ifdef _MSC_VER #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 >= 1200 // msvc++ 6.0 up to MSVC2013
# if _MSC_VER < 1900 # if _MSC_VER < 1900
# define bcopy(from, to, n) memcpy(to, from, n)
# define snprintf _snprintf # define snprintf _snprintf
# define strdup _strdup # define strdup _strdup
# define copysign _copysign
# endif # endif
# if _MSC_VER < 1800 # if _MSC_VER < 1800
# define isnan _isnan # define isnan _isnan
@ -74,20 +76,17 @@
# if _MSC_VER < 1500 # if _MSC_VER < 1500
# define vsnprintf _vsnprintf # define vsnprintf _vsnprintf
# endif # endif
# define copysign _copysign
# define strcasecmp stricmp
# undef min
# undef max
# pragma warning(disable: 4786) // identifier was truncated to '255' characters # pragma warning(disable: 4786) // identifier was truncated to '255' characters
# pragma warning(disable: 4244) // conversion from double to float # 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 # else
# error What version of MSVC++ is this? # error What version of MSVC++ is this?
# endif # 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 #endif // _MSC_VER

View File

@ -278,6 +278,10 @@ TarExtractor::TarExtractor(const SGPath& rootPath) :
d->zlibStream.next_out = d->zlibOutput; d->zlibStream.next_out = d->zlibOutput;
} }
TarExtractor::~TarExtractor()
{
}
void TarExtractor::extractBytes(const char* bytes, size_t count) void TarExtractor::extractBytes(const char* bytes, size_t count)
{ {
if (d->state >= TarExtractorPrivate::ERROR_STATE) { if (d->state >= TarExtractorPrivate::ERROR_STATE) {

View File

@ -34,6 +34,7 @@ class TarExtractor
{ {
public: public:
TarExtractor(const SGPath& rootPath); TarExtractor(const SGPath& rootPath);
~TarExtractor();
void extractBytes(const char* bytes, size_t count); void extractBytes(const char* bytes, size_t count);