From 68c03edbb563983b6ac3e81a826871bfdf9e3bd4 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Thu, 13 Dec 2018 02:28:57 +0300 Subject: Build: Splid the main CMake build script Keep it have library code only but no utils and examples are will be built independently #196 --- src/cvt_xmi2mid.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/cvt_xmi2mid.hpp') 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 -#define XMI2MID_TRACE(fmt, ...) \ - fprintf(stderr, "XMI2MID: " fmt "\n", ## __VA_ARGS__) +#include +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(ff), args); + va_end(args); + return ret; +} #endif typedef struct _xmi2mid_midi_event { -- cgit v1.2.3