diff --git a/crnlib/crn_platform.cpp b/crnlib/crn_platform.cpp index acae60c9..09c3981f 100644 --- a/crnlib/crn_platform.cpp +++ b/crnlib/crn_platform.cpp @@ -5,7 +5,8 @@ #if CRNLIB_USE_WIN32_API #include "crn_winhdr.h" #endif -#ifndef _MSC_VER + +#if !defined(_MSC_VER) && !defined(__MINGW32__) int sprintf_s(char* buffer, size_t sizeOfBuffer, const char* format, ...) { if (!sizeOfBuffer) return 0; @@ -54,7 +55,7 @@ char* strupr(char* p) { } return p; } -#endif // __GNUC__ +#endif void crnlib_debug_break(void) { CRNLIB_BREAKPOINT diff --git a/crnlib/crn_platform.h b/crnlib/crn_platform.h index 70d8dfd2..cffa6abc 100644 --- a/crnlib/crn_platform.h +++ b/crnlib/crn_platform.h @@ -66,7 +66,7 @@ const bool c_crnlib_big_endian_platform = !c_crnlib_little_endian_platform; #define CRNLIB_GET_ALIGNMENT(v) ((!sizeof(v)) ? 1 : (__alignof(v) ? __alignof(v) : sizeof(uint32))) -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__MINGW32__) int sprintf_s(char* buffer, size_t sizeOfBuffer, const char* format, ...); int vsprintf_s(char* buffer, size_t sizeOfBuffer, const char* format, va_list args); char* strlwr(char* p);