Skip to content

Commit

Permalink
fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ValleyBell committed Nov 6, 2021
1 parent 0f0b01a commit 5771347
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions emu/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../stdtype.h"
#include "logging.h"

#ifdef _WIN32
#ifdef _MSC_VER
#define vsnprintf _vsnprintf
#endif

Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions player/droplayer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h> // for snprintf()
#include <vector>
#include <algorithm>

Expand All @@ -15,6 +16,11 @@
#include "helper.h"
#include "../emu/logging.h"

#ifdef _MSC_VER
#define snprintf _snprintf
#endif


enum DRO_HWTYPES
{
DROHW_OPL2 = 0,
Expand Down
1 change: 1 addition & 0 deletions player/droplayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../utils/DataLoader.h"
#include "../emu/logging.h"
#include <vector>
#include <string>


#define FCC_DRO 0x44524F00
Expand Down
1 change: 1 addition & 0 deletions player/gymplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "helper.h"
#include "../emu/logging.h"


INLINE UINT32 ReadLE32(const UINT8* data)
{
return (data[0x03] << 24) | (data[0x02] << 16) |
Expand Down
6 changes: 6 additions & 0 deletions player/s98player.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h> // for snprintf()
#include <ctype.h>
#include <vector>
#include <string>
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions player/vgmplayer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h> // for snprintf()
#include <math.h> // for pow()
#include <vector>
#include <string>
Expand Down

0 comments on commit 5771347

Please sign in to comment.