diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2019-11-15 23:16:22 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2019-11-15 23:16:22 +0300 |
commit | 2a2613b2da30dcb835440f9d80f2fbf2a068e29f (patch) | |
tree | a75778dc8a14bff6e11b663c24d489598db89169 /src/adlmidi.cpp | |
parent | 45190534246f6c5186aa1708187d5010363db03d (diff) | |
parent | d21b27084532dca78f07ff87f578330f7c6f9755 (diff) | |
download | libADLMIDI-2a2613b2da30dcb835440f9d80f2fbf2a068e29f.tar.gz libADLMIDI-2a2613b2da30dcb835440f9d80f2fbf2a068e29f.tar.bz2 libADLMIDI-2a2613b2da30dcb835440f9d80f2fbf2a068e29f.zip |
Merge remote-tracking branch 'origin/master' into wip-new-embedded-banks
Diffstat (limited to 'src/adlmidi.cpp')
-rw-r--r-- | src/adlmidi.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index dee99d2..3274716 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -31,6 +31,36 @@ #include "midi_sequencer.hpp" #endif +#if defined(_MSC_VER) && _MSC_VER < 1900 + +#define snprintf c99_snprintf +#define vsnprintf c99_vsnprintf + +__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) +{ + int count = -1; + + if (size != 0) + count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); + if (count == -1) + count = _vscprintf(format, ap); + + return count; +} + +__inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...) +{ + int count; + va_list ap; + + va_start(ap, format); + count = c99_vsnprintf(outBuf, size, format, ap); + va_end(ap); + + return count; +} +#endif + /* Unify MIDI player casting and interface between ADLMIDI and OPNMIDI */ #define GET_MIDI_PLAYER(device) reinterpret_cast<MIDIplay *>((device)->adl_midiPlayer) typedef MIDIplay MidiPlayer; |