FIX BUILD (on Windows): follow changes to make threaded RTS compile with -fasm
[ghc-hetmet.git] / includes / mkDerivedConstants.c
index ec081fb..2fe99b6 100644 (file)
 
 #define str(a,b) #a "_" #b
 
-#define OFFSET(s_type, field) ((unsigned int)&(((s_type*)0)->field))
+#define OFFSET(s_type, field) ((size_t)&(((s_type*)0)->field))
+
+#ifdef mingw32_HOST_OS
+#define SIZET_FMT "d"
+#else
+#define SIZET_FMT "zd"
+#endif
 
 #if defined(GEN_HASKELL)
 #define def_offset(str, offset) \
-    printf("oFFSET_" str " = %d::Int\n", offset);
+    printf("oFFSET_" str " = %" SIZET_FMT "::Int\n", offset);
 #else
 #define def_offset(str, offset) \
-    printf("#define OFFSET_" str " %d\n", offset);
+    printf("#define OFFSET_" str " %" SIZET_FMT "\n", offset);
 #endif
 
 #if defined(GEN_HASKELL)
@@ -179,13 +185,6 @@ main(int argc, char *argv[])
     printf("#define PROF_HDR_SIZE  %d\n", sizeofW(StgProfHeader));
     printf("#define GRAN_HDR_SIZE  %d\n", sizeofW(StgGranHeader));
 
-    printf("#define STD_ITBL_SIZE   %d\n", sizeofW(StgInfoTable));
-    printf("#define RET_ITBL_SIZE   %d\n", sizeofW(StgRetInfoTable) - sizeofW(StgInfoTable));
-    printf("#define PROF_ITBL_SIZE  %d\n", sizeofW(StgProfInfo));
-
-    printf("#define GRAN_ITBL_SIZE  %d\n", 0);
-    printf("#define TICKY_ITBL_SIZE %d\n", 0);
-
     printf("#define BLOCK_SIZE   %d\n", BLOCK_SIZE);
     printf("#define MBLOCK_SIZE   %d\n", MBLOCK_SIZE);  
 
@@ -261,7 +260,8 @@ main(int argc, char *argv[])
     struct_field(StgEntCounter, allocs);
     struct_field(StgEntCounter, registeredp);
     struct_field(StgEntCounter, link);
-    
+    struct_field(StgEntCounter, entry_count);
+
     closure_size(StgUpdateFrame);
     closure_size(StgCatchFrame);
     closure_size(StgStopFrame);
@@ -368,7 +368,6 @@ main(int argc, char *argv[])
     closure_field(StgBCO, instrs);
     closure_field(StgBCO, literals);
     closure_field(StgBCO, ptrs);
-    closure_field(StgBCO, itbls);
     closure_field(StgBCO, arity);
     closure_field(StgBCO, size);
     closure_payload(StgBCO, bitmap);