[MLton-commit] r7019

Ville Laurikari ville at mlton.org
Fri Mar 6 00:42:37 PST 2009


Removed support for anything older than Solaris 8.  AFAIK, we (SSH)
were the only ones using the old versions, and even we don't need to
support them anymore.

Added the MLton_ prefix for std functions defined in solaris.c.

This is tested on Solaris 8 sparc, Solaris 10 amd64, and Solaris 10
sparc.

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

U   mlton/trunk/runtime/platform/solaris.c
U   mlton/trunk/runtime/platform/solaris.h

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

Modified: mlton/trunk/runtime/platform/solaris.c
===================================================================
--- mlton/trunk/runtime/platform/solaris.c	2009-03-06 08:42:33 UTC (rev 7018)
+++ mlton/trunk/runtime/platform/solaris.c	2009-03-06 08:42:36 UTC (rev 7019)
@@ -21,6 +21,8 @@
         case FP_RM: mode = 1; break;
         case FP_RP: mode = 2; break;
         case FP_RZ: mode = 3; break;
+        default:
+                die ("fegetround: invalid mode %d\n", mode);
         }
         return mode;
 }
@@ -31,6 +33,8 @@
         case 1: mode = FP_RM; break;
         case 2: mode = FP_RP; break;
         case 3: mode = FP_RZ; break;
+        default:
+                die ("fesetround: invalid mode %d\n", mode);
         }
         fpsetround (mode);
         return 0;

Modified: mlton/trunk/runtime/platform/solaris.h
===================================================================
--- mlton/trunk/runtime/platform/solaris.h	2009-03-06 08:42:33 UTC (rev 7018)
+++ mlton/trunk/runtime/platform/solaris.h	2009-03-06 08:42:36 UTC (rev 7019)
@@ -15,6 +15,8 @@
 #include <sys/filio.h> /* For FIONBIO, FIONREAD. */
 #include <sys/ioctl.h>
 #include <sys/mman.h>
+/* This is defined in <sys/mman.h>, bet we'll redefine it in export.h. */
+#undef PRIVATE
 #include <sys/param.h>
 #include <sys/poll.h>
 #include <sys/resource.h>
@@ -32,21 +34,11 @@
 #include <unistd.h>
 #include <utime.h>
 
-#include "feround.h"
 #ifdef __sparc__
 #include "float-math.h"
 #include "setenv.h"
 #endif
 
-#define FE_TONEAREST 0
-#define FE_DOWNWARD 1
-#define FE_UPWARD 2
-#define FE_TOWARDZERO 3
-
-#define HAS_FEROUND TRUE
-#define HAS_FPCLASSIFY FALSE
-#define HAS_FPCLASSIFY32 FALSE
-#define HAS_FPCLASSIFY64 TRUE
 #define HAS_MSG_DONTWAIT TRUE
 #define HAS_REMAP FALSE
 #define HAS_SIGALTSTACK TRUE
@@ -56,12 +48,7 @@
 
 #define MLton_Platform_OS_host "solaris"
 
-#define LOG_AUTHPRIV LOG_AUTH
-#define LOG_PERROR 0
 
-int fpclassify32 (float f);
-int fpclassify64 (double d);
-
 #ifndef PRIuPTR
 #define PRIuPTR "u"
 #endif
@@ -70,47 +57,6 @@
 #define PRIxPTR "x"
 #endif
 
-extern char **environ; /* for Posix_ProcEnv_environ */
-
-/* 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 PF_INET6 AF_INET6
-
-struct sockaddr_in6 {
-  int dummy; // quell gcc warnings about "struct has no members"
-};
-struct sockaddr_storage {
-  union {
-    struct sockaddr_in sa_in;
-    struct sockaddr_un sa_un;
-  } sa;
-};
-
-#endif /* AF_INET6 */
-
-/* Solaris 2.6 does not define suseconds_t in system headers. */
-#ifndef _SUSECONDS_T
-#define _SUSECONDS_T
-typedef long    suseconds_t;    /* signed # of microseconds */
-#endif /* _SUSECONDS_T */
-
-/* Solaris 2.6 does not define socklen_t in system headers. */
-#ifndef _SOCKLEN_T
-#define _SOCKLEN_T
-#if defined(_XPG4_2) && !defined(_XPG5) && !defined(_LP64)
-typedef size_t socklen_t;
-#else
-typedef uint32_t socklen_t;
-#endif /* defined(_XPG4_2) && !defined(_XPG5) && !defined(_LP64) */
-#endif /* _SOCKLEN_T */
-
 /* Solaris 8 and older do not define a value for UINTPTR_MAX, so
    we redefine it with a value. */
 #ifdef UINTPTR_MAX
@@ -121,3 +67,46 @@
 #define UINTPTR_MAX     UINT32_MAX
 #endif
 #endif
+
+
+/* ------------------------------------------------- */
+/*                  Posix.ProcEnv                    */
+/* ------------------------------------------------- */
+
+extern char **environ;
+
+
+/* ------------------------------------------------- */
+/*                  MLton.Syslog                     */
+/* ------------------------------------------------- */
+
+#define LOG_AUTHPRIV LOG_AUTH
+#define LOG_PERROR 0
+
+
+/* ------------------------------------------------- */
+/*                         Real                      */
+/* ------------------------------------------------- */
+
+#ifdef __sparc__
+#undef fegetround
+#undef fesetround
+#define fegetround MLton_fegetround
+#define fesetround MLton_fesetround
+int fegetround(void);
+int fesetround(int rounding_mode);
+#endif
+
+#undef fpclassify64
+#define fpclassify64 MLton_fpclassify64
+int fpclassify64 (double d);
+
+#define FE_TONEAREST  0
+#define FE_DOWNWARD   1
+#define FE_UPWARD     2
+#define FE_TOWARDZERO 3
+
+#define HAS_FEROUND      TRUE
+#define HAS_FPCLASSIFY   FALSE
+#define HAS_FPCLASSIFY32 FALSE
+#define HAS_FPCLASSIFY64 TRUE




More information about the MLton-commit mailing list