MinGW
authorNils Durner <durner@gnunet.org>
Sat, 27 Nov 2010 15:47:58 +0000 (15:47 +0000)
committerNils Durner <durner@gnunet.org>
Sat, 27 Nov 2010 15:47:58 +0000 (15:47 +0000)
src/nat/nat.c
src/nat/upnp-commands.c
src/nat/upnp-discover.c
src/nat/upnp.c

index eb203265cfee4f9b0af2f6628439940d8f7fa9b0..ca6df05736553a3281549bc406483aa2f3972869 100644 (file)
@@ -131,7 +131,7 @@ get_nat_state_str (enum GNUNET_NAT_PortState state)
 static int
 get_traversal_status (const struct GNUNET_NAT_Handle *h)
 {
-  return MAX (h->natpmp_status, h->upnp_status);
+  return GNUNET_MAX (h->natpmp_status, h->upnp_status);
 }
 
 
index d9962117d5a79cd78b4bfdde38ba7f14de5ebd5b..00655f7530a8880db2ee2031f51b24ffca4807fe 100644 (file)
@@ -320,12 +320,12 @@ parse_url (const char *url, char *hostname, unsigned short *port, char **path)
 
   if (!p2 || (p2 > p3))
     {
-      strncpy (hostname, p1, MIN (MAX_HOSTNAME_LEN, (int) (p3 - p1)));
+      strncpy (hostname, p1, GNUNET_MIN (MAX_HOSTNAME_LEN, (int) (p3 - p1)));
       *port = 80;
     }
   else
     {
-      strncpy (hostname, p1, MIN (MAX_HOSTNAME_LEN, (int) (p2 - p1)));
+      strncpy (hostname, p1, GNUNET_MIN (MAX_HOSTNAME_LEN, (int) (p2 - p1)));
       *port = 0;
       p2++;
 
index 5e955db450ecb021b2c13b8a797dbe7ea2cdc6a1..cb1855ccd6456df9debc99bdc270d83cda6dccd3 100644 (file)
@@ -1201,7 +1201,12 @@ UPNP_discover_ (const char *multicastif,
         {
           if (multicastif)
             {
+#ifndef MINGW
               if_index = if_nametoindex (multicastif);
+#else
+              // FIXME
+              if_index = 0;
+#endif
               if (!if_index)
                 PRINT_SOCKET_ERROR ("if_nametoindex");
 
index 8dd7d626cf2bff1928fcca562b95038b1fd04c77..23168d20a5bb97513bf71bafeddb376933a806dc 100644 (file)
@@ -302,7 +302,12 @@ get_ip_address_cb (int error, char *ext_addr, void *cls)
         }
 
       /* Try IPv4 and IPv6 as we don't know what's the format */
+#ifndef MINGW
       if (inet_aton (ext_addr, &addr) != 0)
+#else
+      addr.S_un.S_addr = inet_addr(ext_addr);
+      if (addr.S_un.S_addr == INADDR_NONE)
+#endif
         {
           handle->ext_addr = GNUNET_malloc (sizeof (struct sockaddr_in));
           handle->ext_addr->sa_family = AF_INET;