diff --git a/CMakeLists.txt b/CMakeLists.txt index 8df466cb5..6abf9fa97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,7 +194,6 @@ REQUIRE_CXX_SOURCE_COMPILES("template class C; int main() { return 0 # time, so the test below works. REQUIRE_CXX_SOURCE_COMPILES("#include \nint main() { std::cregex_iterator ri; }" HAVE_WORKING_REGEX " If you are using gcc, please update to gcc 4.9.") check_cxx_symbol_exists(vasprintf stdio.h HAVE_VASPRINTF) -check_cxx_symbol_exists(__mingw_vasprintf stdio.h HAVE___MINGW_VASPRINTF) ############################################################################ # Check for required system headers diff --git a/config.h.cmake b/config.h.cmake index af2a6ccd9..aa8ead2e0 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -74,9 +74,6 @@ /* Define to 1 if you have the `vasprintf' function. */ #cmakedefine HAVE_VASPRINTF 1 -/* Define to 1 if you have the `__mingw_vasprintf' function. */ -#cmakedefine HAVE___MINGW_VASPRINTF 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H 1 diff --git a/src/lib/Standard.h b/src/lib/Standard.h index 906e17f8e..6bceeb631 100644 --- a/src/lib/Standard.h +++ b/src/lib/Standard.h @@ -155,6 +155,10 @@ bool SWildcardMatchEx(const char *szString, const char *szWildcard); #include #include +#ifdef _WIN32 +#define vsnprintf _vsprintf_p +#endif + // old, insecure sprintf inline int osprintf(char *str, const char *fmt, ...) GNUC_FORMAT_ATTRIBUTE_O; inline int osprintf(char *str, const char *fmt, ...) diff --git a/src/lib/StdBuf.cpp b/src/lib/StdBuf.cpp index 6e89e8ae1..90d6107ca 100644 --- a/src/lib/StdBuf.cpp +++ b/src/lib/StdBuf.cpp @@ -24,7 +24,6 @@ #ifdef _WIN32 #include #include "platform/C4windowswrapper.h" -#define vsnprintf _vsprintf_p #else #define O_BINARY 0 #define O_SEQUENTIAL 0 @@ -35,14 +34,6 @@ #include #include -#if !defined(HAVE_VASPRINTF) && defined(HAVE___MINGW_VASPRINTF) -// MinGW declares a vasprintf-compatible function as __mingw_vasprintf. -// Rename it for our use. -#define vasprintf __mingw_vasprintf -#define HAVE_VASPRINTF -#endif - - // *** StdBuf bool StdBuf::LoadFromFile(const char *szFile) diff --git a/src/script/C4AulCompiler.cpp b/src/script/C4AulCompiler.cpp index 9fa1a0e7e..39ceacf1a 100644 --- a/src/script/C4AulCompiler.cpp +++ b/src/script/C4AulCompiler.cpp @@ -29,10 +29,6 @@ #define C4AUL_SafeInherited "_inherited" #define C4AUL_DebugBreak "__debugbreak" -#ifdef _MSC_VER -#define vsnprintf _vsprintf_p -#endif - static std::string vstrprintf(const char *format, va_list args) { va_list argcopy;