[MLton-commit] r6998

Ville Laurikari ville at mlton.org
Tue Dec 9 10:07:43 PST 2008


Changed cenv.h so that it includes export.h near the end, and removed
some now obsolete occurrences of #include export.h.

Why?  On Solaris 10, the <sys/mman.h> header #defines PRIVATE.
Including export.h after platform.h now redefines the macro so that
the runtime compiles again.

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

U   mlton/trunk/runtime/cenv.h
U   mlton/trunk/runtime/gdtoa-patch.internal
U   mlton/trunk/runtime/gen/gen-types.c
U   mlton/trunk/runtime/platform.h
U   mlton/trunk/runtime/util/to-string.c
U   mlton/trunk/runtime/util.c

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

Modified: mlton/trunk/runtime/cenv.h
===================================================================
--- mlton/trunk/runtime/cenv.h	2008-12-09 17:42:16 UTC (rev 6997)
+++ mlton/trunk/runtime/cenv.h	2008-12-09 18:07:41 UTC (rev 6998)
@@ -131,12 +131,13 @@
 #endif
 
 #include "gmp.h"
+#include "export.h"
 
-COMPILE_TIME_ASSERT(sizeof_uintptr_t__is__sizeof_voidStar, 
+COMPILE_TIME_ASSERT(sizeof_uintptr_t__is__sizeof_voidStar,
                     sizeof(uintptr_t) == sizeof(void*));
-COMPILE_TIME_ASSERT(sizeof_uintptr_t__is__sizeof_size_t, 
+COMPILE_TIME_ASSERT(sizeof_uintptr_t__is__sizeof_size_t,
                     sizeof(uintptr_t) == sizeof(size_t));
-COMPILE_TIME_ASSERT(sizeof_uintptr_t__is__sizeof_ptrdiff_t, 
+COMPILE_TIME_ASSERT(sizeof_uintptr_t__is__sizeof_ptrdiff_t,
                     sizeof(uintptr_t) == sizeof(ptrdiff_t));
 COMPILE_TIME_ASSERT(sizeof_voidStar__is__pointer_bits,
                     sizeof(void*)*CHAR_BIT == POINTER_BITS);

Modified: mlton/trunk/runtime/gdtoa-patch.internal
===================================================================
--- mlton/trunk/runtime/gdtoa-patch.internal	2008-12-09 17:42:16 UTC (rev 6997)
+++ mlton/trunk/runtime/gdtoa-patch.internal	2008-12-09 18:07:41 UTC (rev 6998)
@@ -1,17 +1,9 @@
 --- gdtoa/gdtoaimp.h.orig	2008-10-04 02:27:47 +0000
 +++ gdtoa/gdtoaimp.h	2008-10-04 02:32:34 +0000
-@@ -176,6 +176,7 @@
- #ifndef GDTOAIMP_H_INCLUDED
- #define GDTOAIMP_H_INCLUDED
- #include "gdtoa.h"
-+#include "../export.h"
- 
- #ifdef DEBUG
- #include "stdio.h"
 @@ -529,53 +530,53 @@
  #define trailz trailz_D2A
  #define ulp ulp_D2A
- 
+
 - extern char *dtoa_result;
 - extern CONST double bigtens[], tens[], tinytens[];
 - extern unsigned char hexdig[];
@@ -105,6 +97,6 @@
 +PRIVATE extern Bigint *sum ANSI((Bigint*, Bigint*));
 +PRIVATE extern int trailz ANSI((Bigint*));
 +PRIVATE extern double ulp ANSI((double));
- 
+
  #ifdef __cplusplus
  }

Modified: mlton/trunk/runtime/gen/gen-types.c
===================================================================
--- mlton/trunk/runtime/gen/gen-types.c	2008-12-09 17:42:16 UTC (rev 6997)
+++ mlton/trunk/runtime/gen/gen-types.c	2008-12-09 18:07:41 UTC (rev 6998)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 2004-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  *
  * MLton is released under a BSD-style license.
@@ -6,7 +6,6 @@
  */
 
 #include "cenv.h"
-#include "export.h"
 #include "util.h"
 
 static const char* mlTypesHPrefix[] = {
@@ -306,7 +305,7 @@
   NULL
 };
 
-int main (__attribute__ ((unused)) int argc, 
+int main (__attribute__ ((unused)) int argc,
           __attribute__ ((unused)) char* argv[]) {
   FILE *mlTypesHFd;
   FILE *cTypesHFd;
@@ -323,9 +322,9 @@
   cTypesHFd = fopen_safe ("c-types.h", "w");
   cTypesSMLFd = fopen_safe ("c-types.sml", "w");
 
-  for (int i = 0; cTypesHPrefix[i] != NULL; i++) 
+  for (int i = 0; cTypesHPrefix[i] != NULL; i++)
     writeStringWithNewline (cTypesHFd, cTypesHPrefix[i]);
-  for (int i = 0; cTypesSMLPrefix[i] != NULL; i++) 
+  for (int i = 0; cTypesSMLPrefix[i] != NULL; i++)
     writeStringWithNewline (cTypesSMLFd, cTypesSMLPrefix[i]);
 
   writeNewline (cTypesHFd);writeNewline (cTypesSMLFd);
@@ -429,9 +428,9 @@
   chksystype(mp_limb_t, "MPLimb");
 
   writeNewline (cTypesHFd);writeNewline (cTypesSMLFd);
-  for (int i = 0; cTypesHSuffix[i] != NULL; i++) 
+  for (int i = 0; cTypesHSuffix[i] != NULL; i++)
     writeStringWithNewline (cTypesHFd, cTypesHSuffix[i]);
-  for (int i = 0; cTypesSMLSuffix[i] != NULL; i++) 
+  for (int i = 0; cTypesSMLSuffix[i] != NULL; i++)
     writeStringWithNewline (cTypesSMLFd, cTypesSMLSuffix[i]);
 
   fclose_safe(mlTypesHFd);

Modified: mlton/trunk/runtime/platform.h
===================================================================
--- mlton/trunk/runtime/platform.h	2008-12-09 17:42:16 UTC (rev 6997)
+++ mlton/trunk/runtime/platform.h	2008-12-09 18:07:41 UTC (rev 6998)
@@ -10,7 +10,6 @@
 #define _MLTON_PLATFORM_H_
 
 #include "cenv.h"
-#include "export.h"
 #include "util.h"
 #include "ml-types.h"
 #include "c-types.h"
@@ -124,7 +123,7 @@
 #define MLTON_CODEGEN_STATIC_INLINE PRIVATE
 #endif
 #ifndef MLTON_CODEGEN_MATHFN
-#define MLTON_CODEGEN_MATHFN(decl) 
+#define MLTON_CODEGEN_MATHFN(decl)
 #endif
 #ifndef MLTON_CODEGEN_WORDSQUOTREM
 #define MLTON_CODEGEN_WORDSQUOTREM(func) func
@@ -158,14 +157,14 @@
 /*                Virtual Memory                     */
 /* ------------------------------------------------- */
 
-/* GC_displayMem displays the virtual memory mapping to stdout.  
- * It is used to diagnose memory problems. 
+/* GC_displayMem displays the virtual memory mapping to stdout.
+ * It is used to diagnose memory problems.
  */
 PRIVATE void GC_displayMem (void);
 
 PRIVATE void *GC_mmapAnon (void *start, size_t length);
 PRIVATE void *GC_mmapAnon_safe (void *start, size_t length);
-PRIVATE void *GC_mmapAnon_safe_protect (void *start, size_t length, 
+PRIVATE void *GC_mmapAnon_safe_protect (void *start, size_t length,
                                          size_t dead_low, size_t dead_high);
 PRIVATE void *GC_mremap (void *start, size_t oldLength, size_t newLength);
 PRIVATE void GC_release (void *base, size_t length);

Modified: mlton/trunk/runtime/util/to-string.c
===================================================================
--- mlton/trunk/runtime/util/to-string.c	2008-12-09 17:42:16 UTC (rev 6997)
+++ mlton/trunk/runtime/util/to-string.c	2008-12-09 18:07:41 UTC (rev 6998)
@@ -5,7 +5,6 @@
  * See the file MLton-LICENSE for details.
  */
 
-#include "export.h"
 #include "util.h"
 
 const char* boolToString (bool b) {

Modified: mlton/trunk/runtime/util.c
===================================================================
--- mlton/trunk/runtime/util.c	2008-12-09 17:42:16 UTC (rev 6997)
+++ mlton/trunk/runtime/util.c	2008-12-09 18:07:41 UTC (rev 6998)
@@ -1,10 +1,9 @@
-/* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  *
  * MLton is released under a BSD-style license.
  * See the file MLton-LICENSE for details.
  */
 
-#include "export.h"
 #include "util/die.c"
 #include "util/to-string.c"




More information about the MLton-commit mailing list