Merge pull request #780 from wolfman2000/wolf-vs2015-snprintf-compile

Allow VS2015 to compile StepMania.
This commit is contained in:
Jason Felds
2015-09-15 06:49:54 -04:00
3 changed files with 18 additions and 16 deletions
+15 -10
View File
@@ -84,16 +84,21 @@ include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckCXXSymbolExists)
if (WIN32 AND MSVC)
check_function_exists(_mkdir HAVE__MKDIR)
check_function_exists(_snprintf HAVE__SNPRINTF)
else()
check_function_exists(fcntl HAVE_FCNTL)
check_function_exists(fork HAVE_FORK)
check_function_exists(mkdir HAVE_MKDIR)
check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(waitpid HAVE_WAITPID)
endif()
# Mostly Windows functions.
check_function_exists(_mkdir HAVE__MKDIR)
check_cxx_symbol_exists(_snprintf cstdio HAVE__SNPRINTF)
#check_function_exists(_snprintf HAVE__SNPRINTF)
# Mostly non-Windows functions.
check_function_exists(fcntl HAVE_FCNTL)
check_function_exists(fork HAVE_FORK)
check_function_exists(mkdir HAVE_MKDIR)
#check_function_exists(snprintf HAVE_SNPRINTF)
check_cxx_symbol_exists(snprintf cstdio HAVE_SNPRINTF)
check_function_exists(waitpid HAVE_WAITPID)
# Mostly universal symbols.
check_cxx_symbol_exists(powf cmath HAVE_POWF)
check_cxx_symbol_exists(sqrtf cmath HAVE_SQRTF)
check_cxx_symbol_exists(sinf cmath HAVE_SINF)
-4
View File
@@ -62,10 +62,6 @@ C4355: 'this' : used in base member initializer list
// Disable false deprecation warnings in VC2008.
#define _CRT_NONSTDC_NO_WARNINGS
#if defined(_MSC_VER) && _MSC_VER >= 1400 // this is needed in VC8 but breaks VC7
#define _HAS_EXCEPTIONS 0
#endif
// Don't include windows.h everywhere; when we do eventually include it, use these:
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
+3 -2
View File
@@ -136,9 +136,10 @@ typedef long ssize_t;
#endif
/* Ensure we have a function that acts like a size limited sprintf. */
#if defined(HAVE__SNPRINTF)
#if defined(HAVE_SNPRINTF)
#elif defined(HAVE__SNPRINTF)
#define snprintf _snprintf
#elif !defined(HAVE_SNPRINTF)
#else
#error "No size limited sprintf function available. Aborting."
#endif