View previous topic :: View next topic |
Author |
Message |
earizon
Joined: 06 Aug 2014 Posts: 2
|
Posted: Wed Aug 06, 2014 5:23 pm Post subject: miniupnpc path (compile on Android) |
|
|
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)y))
+#endif
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h> |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Tue Aug 26, 2014 6:45 pm Post subject: |
|
|
maybe we should do :
#ifndef MIN
instead of #ifdef ANDROID _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
earizon
Joined: 06 Aug 2014 Posts: 2
|
Posted: Tue Aug 26, 2014 7:18 pm Post subject: |
|
|
miniupnp wrote: | maybe we should do :
#ifndef MIN
instead of #ifdef ANDROID |
Upps, you are right! Much simpler |
|
Back to top |
|
|
|