aboutsummaryrefslogtreecommitdiff
path: root/src/cvt_xmi2mid.hpp
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-12-13 02:28:57 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-12-13 02:29:16 +0300
commit68c03edbb563983b6ac3e81a826871bfdf9e3bd4 (patch)
treec9bdcb2dfeaa60cececdd602b8a9f5fdb0b815fa /src/cvt_xmi2mid.hpp
parentd89084d6eaf3bb65c134201f61449656226cbf80 (diff)
downloadlibADLMIDI-68c03edbb563983b6ac3e81a826871bfdf9e3bd4.tar.gz
libADLMIDI-68c03edbb563983b6ac3e81a826871bfdf9e3bd4.tar.bz2
libADLMIDI-68c03edbb563983b6ac3e81a826871bfdf9e3bd4.zip
Build: Splid the main CMake build script
Keep it have library code only but no utils and examples are will be built independently #196
Diffstat (limited to 'src/cvt_xmi2mid.hpp')
-rw-r--r--src/cvt_xmi2mid.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cvt_xmi2mid.hpp b/src/cvt_xmi2mid.hpp
index e8d9dbf..435de81 100644
--- a/src/cvt_xmi2mid.hpp
+++ b/src/cvt_xmi2mid.hpp
@@ -58,11 +58,21 @@ typedef unsigned long uint32_t;
#define XMI2MID_MIDI_STATUS_SYSEX 0xF
#if 1
-#define XMI2MID_TRACE(...)
+static int XMI2MID_TRACE(...) { return 0; }
#else
#include <stdio.h>
-#define XMI2MID_TRACE(fmt, ...) \
- fprintf(stderr, "XMI2MID: " fmt "\n", ## __VA_ARGS__)
+#include <stdarg.h>
+static int XMI2MID_TRACE(const char *fmt, int n, ...)
+{
+ int ret;
+ char ff[50] = "";
+ snprintf(ff, 49, "XMI2MID: %s\n", fmt);
+ va_list args;
+ va_start(args, n);
+ ret = vfprintf(stderr, const_cast<const char*>(ff), args);
+ va_end(args);
+ return ret;
+}
#endif
typedef struct _xmi2mid_midi_event {