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] Don't #include <utility.h> on sun

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs
View previous topic :: View next topic  
Author Message
cibyr



Joined: 05 Mar 2009
Posts: 1

PostPosted: Thu Mar 05, 2009 5:12 am    Post subject: [PATCH] Don't #include <utility.h> on sun Reply with quote

Including utility.h on Solaris causes problems for me (probably because I'm not using the Sun toolchain or libraries). In any case, there's no point including a whole file just for a macro you're defining anyway, so this patch fixes that.

Code:
diff -ur miniupnp/miniwget.c miniupnp/miniwget.c
--- miniupnp/miniwget.c      2009-03-05 15:01:22.348453493 +1000
+++ miniupnp/miniwget.c   2009-03-05 15:05:20.667854747 +1000
@@ -13,7 +13,6 @@
 #include <winsock2.h>
 #include <io.h>
 #define MAXHOSTNAMELEN 64
-#define MIN(x,y) (((x)<(y))?(x):(y))
 #define snprintf _snprintf
 #define herror
 #define socklen_t int
@@ -26,9 +25,9 @@
 #include <arpa/inet.h>
 #define closesocket close
 #endif
-/* for MIN() macro : */
-#if defined(__sun) || defined(sun)
-#include <utility.h>
+
+#ifndef MIN
+#define MIN(x,y) (((x)<(y))?(x):(y))
 #endif

 /* miniwget2() :
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Fri Mar 06, 2009 6:46 pm    Post subject: Reply with quote

thanks !
_________________
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 -> miniupnpd Bugs 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.