diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-12-21 09:15:20 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-12-21 09:15:20 +0000 |
commit | c1d165ffadfd5b254f5b2c8132ca008f7746da14 (patch) | |
tree | 08747b3c05111ab4f8b0f96b67a6fd058206714d /src/zexy.h | |
parent | aaa2e8470af5e67e13508f89b890823c1d4ae734 (diff) |
removed C99-define-magic for verbose output:
now we just make a static function z_verbose() that calls either verbose() or post()
svn path=/trunk/externals/zexy/; revision=4266
Diffstat (limited to 'src/zexy.h')
-rw-r--r-- | src/zexy.h | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -43,6 +43,7 @@ /* some defines, which turn on special compile-options * (like parallel-port) * the ifdef is here, to not break the externals/build-system + * (read: build-systems outside of zexy) */ # include "zexyconf.h" #endif @@ -50,6 +51,8 @@ #include "m_pd.h" #include <math.h> +#include <stdarg.h> + #define VERSION "2.1" /* these pragmas are only used for MSVC, not MinGW or Cygwin */ @@ -99,15 +102,24 @@ static void zexy_register(char*object){ static void zexy_register(char*object){} #endif /* ZEXY_LIBRARY */ +static void z_verbose(int level, char*fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + #if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 38) -/* pd>=0.39 has a verbose() function; older versions don't +/* + * pd>=0.39 has a verbose() function; older versions don't */ + verbose(level, fmt, ap); #else -/* this might not work on compilers other than gcc - * is it ISO-C99 or just a gnu-cpp thing ? - */ -# define verbose(level, format, ...) post(format, ## __VA_ARGS__) + /* + * fall back to a simple post... + */ + post(fmt, ap); #endif + va_end(ap); +} #endif /* INCLUDE_ZEXY_H__ */ |