[project @ 2000-11-03 17:10:57 by simonpj]
[ghc-hetmet.git] / ghc / rts / Prelude.c
index a3e191f..5f8ed6d 100644 (file)
@@ -1,6 +1,6 @@
 
 /* -----------------------------------------------------------------------------
- * $Id: Prelude.c,v 1.4 2000/03/24 15:19:29 sewardj Exp $
+ * $Id: Prelude.c,v 1.9 2000/08/07 23:37:23 qrczak Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
 #include "Prelude.h"
 
 #if defined(INTERPRETER)
-const StgClosure *ind_True_static_closure;
-const StgClosure *ind_False_static_closure;
+const StgClosure *ind_True_closure;
+const StgClosure *ind_False_closure;
 const StgClosure *ind_unpackCString_closure;
+const StgClosure *ind_runFinalizerBatch_closure;
+
 const StgClosure *ind_stackOverflow_closure;
 const StgClosure *ind_heapOverflow_closure;
-const StgClosure *ind_PutFullMVar_static_closure;
+const StgClosure *ind_PutFullMVar_closure;
 const StgClosure *ind_BlockedOnDeadMVar_closure;
 const StgClosure *ind_NonTermination_closure;
-const StgClosure *ind_mainIO_closure;
 
 const StgInfoTable *ind_Czh_static_info;
 const StgInfoTable *ind_Izh_static_info;
@@ -74,6 +75,17 @@ INFO_TABLE_CONSTR(hugs_standalone_Wzh_static_info,Hugs_CONSTR_entry,
                   0,sizeofW(StgWord),0,CONSTR_NOCAF_STATIC,,EF_,0,0);
 INFO_TABLE_CONSTR(hugs_standalone_StablePtr_static_info,Hugs_CONSTR_entry,
                   0,sizeofW(StgStablePtr),0,CONSTR_NOCAF_STATIC,,EF_,0,0);
+
+#ifdef XMLAMBDA
+/* The Inj constructor: data Inj = forall a. Inj a Int#
+   Since this one is not present in Haskell compiled stuff, we bind it statically. 
+*/
+INFO_TABLE_CONSTR(xmlambda_Inj_con_info,Hugs_CONSTR_entry,
+                  sizeofW(StgPtr),sizeofW(StgInt),0,CONSTR,,EF_,0,0);
+
+const StgInfoTable* ind_Inj_con_info = &xmlambda_Inj_con_info;
+#endif /* XMLAMBDA */
+
 #endif
 
 
@@ -95,15 +107,17 @@ INFO_TABLE_CONSTR(hugs_standalone_StablePtr_static_info,Hugs_CONSTR_entry,
 */
 void fixupRTStoPreludeRefs ( void*(*ask_hugs_dynamic_linker)(char*) )
 {
+  (void)ask_hugs_dynamic_linker;   /* keep gcc -Wall happy */
 #if defined(INTERPRETER)
   if (ask_hugs_dynamic_linker == NULL) {
 
     /* Hugs standalone mode. */
-    ind_True_static_closure        = NULL; /* True_static_closure; */
-    ind_False_static_closure       = NULL; /* False_static_closure; */
-    ind_PutFullMVar_static_closure = NULL; /* PutFullMVar_static_closure; */
-    ind_BlockedOnDeadMVar_closure  = NULL; /* BlockedOnDeadMVar_static_closure; */
-    ind_NonTermination_closure     = NULL; /* NonTermination_static_closure; */
+    ind_True_closure               = NULL; /* True__closure; */
+    ind_False_closure              = NULL; /* False_closure; */
+    ind_runFinalizerBatch_closure  = NULL; /* runFinalizerBatch_closure; */
+    ind_PutFullMVar_closure        = NULL; /* PutFullMVar_closure; */
+    ind_BlockedOnDeadMVar_closure  = NULL; /* BlockedOnDeadMVar_closure; */
+    ind_NonTermination_closure     = NULL; /* NonTermination_closure; */
     ind_unpackCString_closure      = NULL; /* unpackCString_closure; */
 
     ind_stackOverflow_closure = stackOverflow_closure;
@@ -131,12 +145,14 @@ void fixupRTStoPreludeRefs ( void*(*ask_hugs_dynamic_linker)(char*) )
     /* Hugs combined mode. */
     void*(*ask)(char*) = ask_hugs_dynamic_linker;
 
-    ind_True_static_closure           
-       = ask("PrelBase_True_static_closure");
-    ind_False_static_closure          
-       = ask("PrelBase_False_static_closure");
-    ind_PutFullMVar_static_closure    
-       = ask("PrelException_PutFullMVar_static_closure");
+    ind_True_closure           
+       = ask("PrelBase_True_closure");
+    ind_False_closure          
+       = ask("PrelBase_False_closure");
+    ind_runFinalizerBatch_closure    
+       = ask("PrelWeak_runFinalizzerBatch_closure");
+    ind_PutFullMVar_closure    
+       = ask("PrelException_PutFullMVar_closure");
     ind_BlockedOnDeadMVar_closure    
        = ask("PrelException_BlockedOnDeadMVar_closure");
     ind_NonTermination_closure 
@@ -177,10 +193,10 @@ void fixupRTStoPreludeRefs ( void*(*ask_hugs_dynamic_linker)(char*) )
   {
     int i;
   
-    for(i=0;i<=255;i++)
+    for(i=0; i<=MAX_CHARLIKE-MIN_CHARLIKE; i++)
       (CHARLIKE_closure[i]).header.info = Czh_static_info;
     
-    for(i=0;i<=32;i++)
+    for(i=0; i<=MAX_INTLIKE-MIN_INTLIKE; i++)
       (INTLIKE_closure[i]).header.info = Izh_static_info;
   }
 #endif