diff --git a/emu/logging.c b/emu/logging.c index 31ac2ee9..5cccd73c 100644 --- a/emu/logging.c +++ b/emu/logging.c @@ -4,7 +4,7 @@ #include "../stdtype.h" #include "logging.h" -#ifdef _WIN32 +#ifdef _MSC_VER #define vsnprintf _vsnprintf #endif @@ -21,10 +21,10 @@ void emu_logf(DEV_LOGGER* logger, UINT8 level, const char* format, ...) return; va_start(arg_list, format); - retVal = _vsnprintf(buffer, LOGBUF_SIZE, format, arg_list); + retVal = vsnprintf(buffer, LOGBUF_SIZE, format, arg_list); va_end(arg_list); if (retVal < 0 || retVal >= LOGBUF_SIZE) - buffer[LOGBUF_SIZE - 1] = '\0'; // for older MSVC version and glibc <= 2.0.6 + buffer[LOGBUF_SIZE - 1] = '\0'; // required for older MSVC versions logger->func(logger->param, logger->source, level, buffer); return; diff --git a/player/droplayer.cpp b/player/droplayer.cpp index 0ccae3bf..008652f8 100644 --- a/player/droplayer.cpp +++ b/player/droplayer.cpp @@ -1,5 +1,6 @@ #include #include +#include // for snprintf() #include #include @@ -15,6 +16,11 @@ #include "helper.h" #include "../emu/logging.h" +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + + enum DRO_HWTYPES { DROHW_OPL2 = 0, diff --git a/player/droplayer.hpp b/player/droplayer.hpp index 46f37a93..5e90bf11 100644 --- a/player/droplayer.hpp +++ b/player/droplayer.hpp @@ -9,6 +9,7 @@ #include "../utils/DataLoader.h" #include "../emu/logging.h" #include +#include #define FCC_DRO 0x44524F00 diff --git a/player/gymplayer.cpp b/player/gymplayer.cpp index 2e8aafbc..97101fe6 100644 --- a/player/gymplayer.cpp +++ b/player/gymplayer.cpp @@ -18,6 +18,7 @@ #include "helper.h" #include "../emu/logging.h" + INLINE UINT32 ReadLE32(const UINT8* data) { return (data[0x03] << 24) | (data[0x02] << 16) | diff --git a/player/s98player.cpp b/player/s98player.cpp index bf673490..e845d0c3 100644 --- a/player/s98player.cpp +++ b/player/s98player.cpp @@ -1,5 +1,6 @@ #include #include +#include // for snprintf() #include #include #include @@ -20,6 +21,11 @@ #include "helper.h" #include "../emu/logging.h" +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + + enum S98_DEVTYPES { S98DEV_NONE = 0, // S98 v2 End-Of-Device marker diff --git a/player/vgmplayer.cpp b/player/vgmplayer.cpp index f30c87fc..2b38dd59 100644 --- a/player/vgmplayer.cpp +++ b/player/vgmplayer.cpp @@ -1,5 +1,6 @@ #include #include +#include // for snprintf() #include // for pow() #include #include