]> git.sesse.net Git - vlc/commitdiff
Do not define constant manually without platform check!
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 21 Nov 2006 20:34:51 +0000 (20:34 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 21 Nov 2006 20:34:51 +0000 (20:34 +0000)
(and even, it pretty much sucks as we have seen already)
Should fix compilation on FreeBSD+glibc.

modules/misc/network/ipv6.c

index 8a2be3170721d92130a883f68214995bb9fedcd5..7a1f3fb6195ecffca7bb2905ab04fdf85fa02079 100644 (file)
 #   include <winsock2.h>
 #   include <ws2tcpip.h>
 #   define if_nametoindex( str ) atoi( str )
-#else
-#   include <sys/types.h>
-#   include <unistd.h>
-#   include <netdb.h>                                         /* hostent ... */
-#   include <sys/socket.h>
-#   include <netinet/in.h>
-#   include <net/if.h>
-#endif
-
-#include "network.h"
 
-#if defined(WIN32)
 static const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
 # define close closesocket
-#endif
 
 #ifndef MCAST_JOIN_SOURCE_GROUP
-# ifdef WIN32
+/*
+ * I hate manual definitions: Error-prone. Portability hell.
+ * Developers shall use UP-TO-DATE compilers. Full point.
+ * If you remove the warning, you remove the whole ifndef.
+ */
+# warning Your C headers are out-of-date. Please update.
+
 /* Most (all?) Mingw32 versions in use are yet to pick up Vista stuff */
 #  define MCAST_JOIN_SOURCE_GROUP 45 /* from <ws2ipdef.h> */
-# else
-#  define MCAST_JOIN_SOURCE_GROUP 46
-# endif
 struct group_source_req
 {
        uint32_t           gsr_interface;  /* interface index */
@@ -69,6 +60,17 @@ struct group_source_req
 };
 #endif
 
+#else
+#   include <sys/types.h>
+#   include <unistd.h>
+#   include <netdb.h>                                         /* hostent ... */
+#   include <sys/socket.h>
+#   include <netinet/in.h>
+#   include <net/if.h>
+#endif
+
+#include "network.h"
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/