From 2b5587e3abb9c1a9919fcc26f369d4956ad8f0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 14 Mar 2024 13:24:40 +0100 Subject: [PATCH] use PD_VERSION_CODE for version comparision --- iemnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/iemnet.c b/iemnet.c index 1b9aaa6..217fc09 100644 --- a/iemnet.c +++ b/iemnet.c @@ -30,8 +30,12 @@ # include #endif +#ifndef PD_VERSION_CODE +# define PD_VERSION_CODE IEMNET_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) +#endif + -#if IEMNET_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) < IEMNET_VERSION(0, 52, 0) +#if PD_VERSION_CODE < IEMNET_VERSION(0, 52, 0) # define PD_DEBUG 3 #endif @@ -237,7 +241,7 @@ int iemnet__register(const char*name) post(" copyright © 2010-2015 IOhannes m zmoelnig, IEM"); post(" based on mrpeach/net, based on maxlib"); } -#if IEMNET_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) > IEMNET_VERSION(0, 43, 0) +#if PD_VERSION_CODE > IEMNET_VERSION(0, 43, 0) logpost(0, PD_DEBUG, "iemnet: loaded [%s]", name); #else post("iemnet: loaded [%s]", name); @@ -314,7 +318,7 @@ void iemnet_log(const void *object, const t_iemnet_loglevel level, const char *f vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); strcat(buf, "\0"); -#if IEMNET_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) > IEMNET_VERSION(0, 43, 0) +#if PD_VERSION_CODE > IEMNET_VERSION(0, 43, 0) logpost(x, level, "[%s]: %s", name, buf); #else if(level>1) {