miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to distinguish between different upnpc versions

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Compilation/Installation
View previous topic :: View next topic  
Author Message
mwarning



Joined: 16 Sep 2013
Posts: 1

PostPosted: Mon Sep 16, 2013 6:34 pm    Post subject: how to distinguish between different upnpc versions Reply with quote

Hi,

I wrote some code that uses e.g. upnpDiscover(), but the function signature changed between 1.5 and 1.6
Is there a nice way to distinguish between those versions?

#ifdef UPNPDISCOVER_SUCCESS
#define HAVE_MINIUPNP_16 1
#else
#define HAVE_MINIUPNP_15 1
#endif

This code above is somewhat cheap and brittle.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Wed Sep 25, 2013 7:55 am    Post subject: Reply with quote

you can use something like
Code:

#if defined(MINIUPNPC_API_VERSION) && (MINIUPNPC_API_VERSION >= 8)
...
#else
...
#endif

_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Compilation/Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.