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 

miniupnpc path (compile on Android)

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



Joined: 06 Aug 2014
Posts: 2

PostPosted: Wed Aug 06, 2014 5:23 pm    Post subject: miniupnpc path (compile on Android) Reply with quote

Hello all,

I needed to port the client to Android for a personal project. I found the MIN macro is not defined on Android. Next patch fix the issue:

diff --git a/miniupnpc/miniwget.c b/miniupnpc/miniwget.c
index 813db93..968c8d0 100644
--- a/miniupnpc/miniwget.c
+++ b/miniupnpc/miniwget.c
@@ -10,6 +10,9 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#ifdef ANDROID
+#define MIN(x,y) (((x)<(y))?(x)Sady))
+#endif
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1429

PostPosted: Tue Aug 26, 2014 6:45 pm    Post subject: Reply with quote

maybe we should do :
#ifndef MIN
instead of #ifdef ANDROID Smile
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
earizon



Joined: 06 Aug 2014
Posts: 2

PostPosted: Tue Aug 26, 2014 7:18 pm    Post subject: Reply with quote

miniupnp wrote:
maybe we should do :
#ifndef MIN
instead of #ifdef ANDROID Smile


Upps, you are right! Much simpler Confused
Back to top
View user's profile Send private message
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.