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 

[PATCH] Compilability

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



Joined: 25 Nov 2010
Posts: 3

PostPosted: Thu Nov 25, 2010 8:22 am    Post subject: [PATCH] Compilability Reply with quote

Hey,

this is what we needed to do in tomahawk-player to make miniupnpc compile on linux for windows with mingw32 and on OS X natively:

Code:

diff --git a/libportfwd/include/portfwd/portfwd.h b/libportfwd/include/portfwd/portfwd.h
index 4c4cf51..faedd8f 100644
--- a/libportfwd/include/portfwd/portfwd.h
+++ b/libportfwd/include/portfwd/portfwd.h
@@ -1,3 +1,5 @@
+#ifndef LIBPORTFWD_PORTFWD_H
+#define LIBPORTFWD_PORTFWD_H true
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -34,3 +36,4 @@ class Portfwd
         unsigned int m_upbps, m_downbps;
 };
 
+#endif
\ No newline at end of file
diff --git a/libportfwd/third-party/miniupnpc-1.4.20100609/minissdpc.c b/libportfwd/third-party/miniupnpc-1.4.20100609/minissdpc.c
index 33ffa3a..6c6b036 100644
--- a/libportfwd/third-party/miniupnpc-1.4.20100609/minissdpc.c
+++ b/libportfwd/third-party/miniupnpc-1.4.20100609/minissdpc.c
@@ -23,7 +23,9 @@
 #define uint16_t unsigned short
 #endif
 /* Hack */
+#include <winsock.h>
 #define UNIX_PATH_LEN   108
+#include <stdint.h>
 struct sockaddr_un {
   uint16_t sun_family;
   char     sun_path[UNIX_PATH_LEN];
diff --git a/libportfwd/third-party/miniupnpc-1.4.20100609/miniupnpc.c b/libportfwd/third-party/miniupnpc-1.4.20100609/miniupnpc.c
index 484a17e..40dc19d 100644
--- a/libportfwd/third-party/miniupnpc-1.4.20100609/miniupnpc.c
+++ b/libportfwd/third-party/miniupnpc-1.4.20100609/miniupnpc.c
@@ -16,6 +16,10 @@
 #endif
 #endif
 
+#ifdef __APPLE__
+#define _DARWIN_C_SOURCE
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -24,7 +28,7 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <io.h>
-#include <IPHlpApi.h>
+#include <iphlpapi.h>
 #define snprintf _snprintf
 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
 #define strncasecmp _memicmp



I'd appreciate if you add in the next upstream version Smile


Best regards,
Domme
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Thu Nov 25, 2010 9:57 am    Post subject: Reply with quote

ok, thanks.
the _DARWIN_C_SOURCE macro is defined in the Makefile instead.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Mon Jan 03, 2011 4:12 pm    Post subject: Reply with quote

Should be ok for a moment. Check into miniupnpc-1.5.
_________________
Main miniUPnP author.
https://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.