Add IPV6_FLOWINFO and IF_NAMESIZE values into generated package
System.OS_Constants.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * gsocket.h: Include net/if.h to get IF_NAMESIZE constant.
        * s-oscons-tmplt.c: Define IPV6_FLOWINFO for Linux.
diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h
--- a/gcc/ada/gsocket.h
+++ b/gcc/ada/gsocket.h
@@ -215,6 +215,7 @@
 #if !(defined (VMS) || defined (__MINGW32__))
 #include <sys/socket.h>
 #include <sys/un.h>
+#include <net/if.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <sys/ioctl.h>


diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -1689,8 +1689,14 @@ CND(IPV6_DSTOPTS, "Set the destination options delivery")
 CND(IPV6_HOPOPTS, "Set the hop options delivery")
 
 #ifndef IPV6_FLOWINFO
+#ifdef __linux__
+/* The IPV6_FLOWINFO is defined in linux/in6.h, but we can't include it because
+ * of conflicts with other headers. */
+# define IPV6_FLOWINFO 11
+#else
 # define IPV6_FLOWINFO -1
 #endif
+#endif
 CND(IPV6_FLOWINFO, "Set the flow ID delivery")
 
 #ifndef IPV6_HOPLIMIT


Reply via email to