[MLton-commit] r5484

Matthew Fluet fluet at mlton.org
Thu Mar 29 08:57:26 PST 2007


Regularize handling of missing IPv6 functionality
----------------------------------------------------------------------

U   mlton/trunk/runtime/platform/cygwin.h
U   mlton/trunk/runtime/platform/hpux.h
U   mlton/trunk/runtime/platform/solaris.h

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/platform/cygwin.h
===================================================================
--- mlton/trunk/runtime/platform/cygwin.h	2007-03-29 16:39:32 UTC (rev 5483)
+++ mlton/trunk/runtime/platform/cygwin.h	2007-03-29 16:57:25 UTC (rev 5484)
@@ -35,22 +35,24 @@
 
 /* This should not conflict with existing flags. */
 #define MSG_DONTWAIT 0x1000000
-#define PF_INET6 0
 
+/* Cygwin does not handle IPv6. */
+#ifndef AF_INET6
+
+#define AF_INET6 23 /* Internet Protocol, Version 6 */
+#define PF_INET6 AF_INET6
+
 struct sockaddr_in6 {
   int dummy; // quell gcc warnings about "struct has no members"
 };
 
+/* Cygwin does provide sockaddr_storage. */
+
+#endif
+
 typedef unsigned int nfds_t;
 typedef long suseconds_t; // type of timeval.tv_usec in sys/time.h
 
-// /usr/include/cygwin/socket.h has this ifdef'd out for now.
-#define AF_INET6 23
-
 // Unimplemented on Cygwin
 #define MSG_WAITALL 0
 #define MSG_EOR 0
-
-
-
-

Modified: mlton/trunk/runtime/platform/hpux.h
===================================================================
--- mlton/trunk/runtime/platform/hpux.h	2007-03-29 16:39:32 UTC (rev 5483)
+++ mlton/trunk/runtime/platform/hpux.h	2007-03-29 16:57:25 UTC (rev 5484)
@@ -41,15 +41,20 @@
 /* This should not conflict with existing flags. */
 #define MSG_DONTWAIT 0x1000000
 
-#ifndef PF_INET6
-/* Old versions of HP-UX don't have IPv6 support. */
-struct sockaddr_in6 { char dummy; };
+/* Old versions of HP-UX do not handle IPv6. */
+#ifndef AF_INET6
+
+#define AF_INET6 22 /* Internet Protocol, Version 6 */
+#define PF_INET6 AF_INET6
+
+struct sockaddr_in6 { 
+  int dummy; // quell gcc warnings about "struct has no members"
+};
 #define sockaddr_storage sockaddr_in
-#define PF_INET6 0
-#define AF_INET6 0
+
 #endif
 
-typedef long suseconds_t;
+typedef long suseconds_t; // type of timeval.tv_usec in sys/time.h
 
 /* These GCC builtins aren't defined in the system headers. */
 float modff(float x, float *iptr);

Modified: mlton/trunk/runtime/platform/solaris.h
===================================================================
--- mlton/trunk/runtime/platform/solaris.h	2007-03-29 16:39:32 UTC (rev 5483)
+++ mlton/trunk/runtime/platform/solaris.h	2007-03-29 16:57:25 UTC (rev 5484)
@@ -58,15 +58,17 @@
 
 extern char **environ; /* for Posix_ProcEnv_environ */
 
-/* Solaris 7 does not define MAP_ANON and does not handle IPv6 */
+/* Solaris 7 does not define MAP_ANON. */
 
 #ifndef MAP_ANON
 #define MAP_ANON        0x100           /* map anonymous pages directly */
 #endif
 
+/* Solaris 7 does not handle IPv6. */
+
 #ifndef AF_INET6
 
-#define AF_INET6        26              /* Internet Protocol, Version 6 */
+#define AF_INET6 26 /* Internet Protocol, Version 6 */
 #define PF_INET6 AF_INET6
 
 struct sockaddr_in6 { 
@@ -75,4 +77,3 @@
 #define sockaddr_storage sockaddr_in
 
 #endif
-




More information about the MLton-commit mailing list