Skip to content

Commit

Permalink
crnlib: do not redefine sprintf_s on MinGW too
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jun 24, 2024
1 parent a610ffa commit cedc6a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions crnlib/crn_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -54,7 +55,7 @@ char* strupr(char* p) {
}
return p;
}
#endif // __GNUC__
#endif

void crnlib_debug_break(void) {
CRNLIB_BREAKPOINT
Expand Down
2 changes: 1 addition & 1 deletion crnlib/crn_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cedc6a4

Please sign in to comment.