[project @ 2000-04-26 09:29:37 by simonmar]
[ghc-hetmet.git] / ghc / includes / StgTypes.h
index da20c33..4b367ac 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgTypes.h,v 1.6 1999/07/15 16:11:29 panne Exp $
+ * $Id: StgTypes.h,v 1.11 2000/04/13 15:37:11 panne Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -17,7 +17,7 @@
        StgInt                  Signed version of StgWord
        StgAddr                 Generic address type
        
-
+ * WARNING: Keep this file and HsFFI.h in synch!
  *
  * ---------------------------------------------------------------------------*/
 
@@ -27,6 +27,7 @@
 /*
  * First, platform-dependent definitions of size-specific integers.
  * Assume for now that the int type is 32 bits.
+ * NOTE: Synch the following definitions with MachDeps.h!
  * ToDo: move these into a platform-dependent file.
  */
 
@@ -41,7 +42,7 @@ typedef unsigned short           StgWord16;
 typedef signed   int             StgInt32;
 typedef unsigned int             StgWord32;
 #else
-#error GHC untested on this architecture: sizeof(unisgned int) != 4
+#error GHC untested on this architecture: sizeof(unsigned int) != 4
 #endif
 
 /* This #define controls whether we need to support long longs on a particular
@@ -89,7 +90,7 @@ typedef void*              StgAddr;
  */
 
 typedef StgWord8           StgChar;
-
+typedef int                StgBool;
 /*
  * If a double fits in an StgWord, don't bother using floats.
  */
@@ -111,7 +112,7 @@ typedef StgWord            StgOffset;        /* byte offset within closure */
                            
 typedef struct StgTSO_*    StgTSOPtr;
 
-typedef void *             StgForeignPtr;
+typedef void*              StgForeignPtr;
 
 typedef StgInt             StgStackOffset;   /* offset in words! */
 
@@ -129,8 +130,12 @@ typedef StgWord64         LW_;
 /* Stable Pointers:  A stable pointer is represented as an index into
  * the stable pointer table in the low 24 bits with a weight in the
  * upper 8 bits.
+ * SUP: StgStablePtr used to be a synonym for StgWord, but stable pointers
+ * are guaranteed to be void* on the C-side, so we have to do some occasional
+ * casting. Size is not a matter, because StgWord is always the same size as
+ * a void*.
  */
-typedef StgWord            StgStablePtr;
+typedef void*             StgStablePtr;
 
 #define STABLEPTR_WEIGHT_MASK   ((StgWord)0xff << ((sizeof(StgWord)-1) * BITS_PER_BYTE))
 #define STABLEPTR_WEIGHT_SHIFT  (BITS_IN(StgWord) - 8)
@@ -193,5 +198,4 @@ typedef StgClosurePtr   L_;
 
 #define stgCast(ty,e) ((ty)(e))
 
-#endif STGTYPES_H
-
+#endif /* STGTYPES_H */