Skip to content

Commit

Permalink
use IEMNET_VERSION macro to check for compat
Browse files Browse the repository at this point in the history
  • Loading branch information
umlaeute committed Mar 14, 2024
1 parent 56fb8cd commit 45ceca5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion iemnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
# include <sys/un.h>
#endif


#if IEMNET_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) < IEMNET_VERSION(0, 52, 0)
# define PD_DEBUG 3
#endif

/* close a socket properly */
void iemnet__closesocket(int sockfd, int verbose)
{
Expand Down Expand Up @@ -232,7 +237,11 @@ 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)
logpost(0, PD_DEBUG, "iemnet: loaded [%s]", name);
#else
post("iemnet: loaded [%s]", name);
#endif

firsttime = 0;
return 1;
Expand Down Expand Up @@ -305,7 +314,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 (defined PD_MINOR_VERSION) && (PD_MINOR_VERSION >= 43)
#if IEMNET_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) > IEMNET_VERSION(0, 43, 0)
logpost(x, level, "[%s]: %s", name, buf);
#else
if(level>1) {
Expand Down

0 comments on commit 45ceca5

Please sign in to comment.