[MLton-commit] r6860
Wesley Terpstra
wesley at mlton.org
Wed Sep 17 19:03:54 PDT 2008
Define the CPointer and Objptr types in ml-types.h. This gets it included
in -export-headers between the #ifdef ML_TYPES. Otherwise it appears multiple
times when linking several ML libraries---resulting in a link error.
----------------------------------------------------------------------
U mlton/trunk/include/bytecode.h
U mlton/trunk/include/c-chunk.h
U mlton/trunk/include/common-main.h
U mlton/trunk/mlton/main/compile.fun
U mlton/trunk/runtime/gen/gen-types.c
----------------------------------------------------------------------
Modified: mlton/trunk/include/bytecode.h
===================================================================
--- mlton/trunk/include/bytecode.h 2008-09-18 01:13:38 UTC (rev 6859)
+++ mlton/trunk/include/bytecode.h 2008-09-18 02:03:53 UTC (rev 6860)
@@ -9,8 +9,4 @@
#include "ml-types.h"
#include "c-types.h"
#include "export.h"
-
-typedef Pointer CPointer;
-typedef Pointer Objptr;
-
#include "interpret.h"
Modified: mlton/trunk/include/c-chunk.h
===================================================================
--- mlton/trunk/include/c-chunk.h 2008-09-18 01:13:38 UTC (rev 6859)
+++ mlton/trunk/include/c-chunk.h 2008-09-18 02:03:53 UTC (rev 6860)
@@ -15,9 +15,6 @@
#include "c-types.h"
#include "c-common.h"
-typedef Pointer CPointer;
-typedef Pointer Objptr;
-
#ifndef TRUE
#define TRUE 1
#endif
Modified: mlton/trunk/include/common-main.h
===================================================================
--- mlton/trunk/include/common-main.h 2008-09-18 01:13:38 UTC (rev 6859)
+++ mlton/trunk/include/common-main.h 2008-09-18 02:03:53 UTC (rev 6860)
@@ -15,9 +15,6 @@
#define MLTON_GC_INTERNAL_BASIS
#include "platform.h"
-typedef Pointer CPointer;
-typedef Pointer Objptr;
-
/* The label must be declared as weak because gcc's optimizer may prove that
* the code that declares the label is dead and hence eliminate the declaration.
*/
Modified: mlton/trunk/mlton/main/compile.fun
===================================================================
--- mlton/trunk/mlton/main/compile.fun 2008-09-18 01:13:38 UTC (rev 6859)
+++ mlton/trunk/mlton/main/compile.fun 2008-09-18 02:03:53 UTC (rev 6860)
@@ -427,9 +427,6 @@
val lib = File.base f
val libcap = CharVector.map Char.toUpper lib
val _ = print "\n"
- val _ = print "typedef void* CPointer;\n"
- val _ = print "typedef Pointer Objptr;\n"
- val _ = print "\n"
val _ =
if !Control.format = Control.Executable
then print "#if 1 /* C executables compile with same symbol scope as ML executables */\n"
Modified: mlton/trunk/runtime/gen/gen-types.c
===================================================================
--- mlton/trunk/runtime/gen/gen-types.c 2008-09-18 01:13:38 UTC (rev 6859)
+++ mlton/trunk/runtime/gen/gen-types.c 2008-09-18 02:03:53 UTC (rev 6860)
@@ -64,10 +64,10 @@
static const char* mlTypesHStd[] = {
"/* ML types */",
- "// typedef void* Pointer;",
- "// typedef uintptr_t Pointer;",
- "// typedef unsigned char* Pointer;",
- "// struct PointerAux { unsigned char z[4]; } __attribute__ ((aligned (4), may_alias));",
+ // "typedef void* Pointer;",
+ // "typedef uintptr_t Pointer;",
+ // "typedef unsigned char* Pointer;",
+ // "struct PointerAux { unsigned char z[4]; } __attribute__ ((aligned (4), may_alias));",
"typedef unsigned char PointerAux __attribute__ ((aligned (4), may_alias));",
"typedef PointerAux* Pointer;",
"#define Array(t) Pointer",
@@ -145,6 +145,8 @@
"typedef String8_t NullString8_t;",
"typedef String8_t NullString8;",
"",
+ "typedef void* CPointer;",
+ "typedef Pointer Objptr;",
NULL
};
More information about the MLton-commit
mailing list