[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / includes / StgTypes.lh
index 24783ae..824f56d 100644 (file)
@@ -85,16 +85,16 @@ typedef unsigned long  *StgPtr;             /* StgPtr is a ptr to a heap object
 typedef StgPtr        *StgPtrPtr;      /* used for A stack pointer */
 typedef long           StgInt;
 
-/* seven shorthand forms: 
-     StgChar, StgWord, StgPtr, StgPtrPtr, StgInt, StgAddr, const StgPtr */
-
-typedef unsigned char  C_;
-typedef unsigned long  W_;
-typedef unsigned long  *P_;
-typedef P_            *PP_;
-typedef long           I_;
-typedef void          *A_;
-typedef const unsigned long *D_;
+#if HAVE_LONG_LONG
+/* These types are only used to allow the passing of
+   64-bit ints from Haskell to ccalls and to ease
+   the implementation of the Int64 and Word64 libraries.
+*/
+typedef unsigned long long int StgWord64;
+typedef long long int          StgInt64;
+typedef StgInt64              LI_;
+typedef StgWord64             LW_;
+#endif
 
 typedef unsigned char  StgChar;
 typedef void          *StgAddr;
@@ -107,6 +107,29 @@ typedef float              StgFloat;
 typedef double         StgDouble;
 #endif
 
+/* seven shorthand forms: 
+     StgChar, StgWord, StgPtr, StgPtrPtr, StgInt, StgAddr, const StgPtr */
+
+typedef StgChar                C_;
+typedef StgWord                W_;
+typedef StgPtr          P_;
+typedef P_            *PP_;
+typedef StgInt         I_;
+typedef void          *A_;
+typedef const unsigned long *D_;
+
+/* Typedefs for the various sized ints
+   (ToDo: better.)
+*/
+
+typedef unsigned char  StgWord8;
+typedef signed char    StgInt8;
+typedef unsigned short StgWord16;
+typedef short         StgInt16;
+typedef unsigned int   StgWord32;
+typedef signed int     StgInt32;
+       
+
 typedef StgPtr         StgArray;
 typedef StgChar                *StgByteArray;
 typedef StgByteArray   B_;
@@ -231,6 +254,18 @@ typedef union __ft
     unpacked_float fu;
   } float_thing;
 
+#if HAVE_LONG_LONG
+typedef union __it
+  { StgInt64 i;
+    unpacked_double iu;
+  } int64_thing;
+
+typedef union __wt
+  { StgWord64 w;
+    unpacked_double wu;
+  } word64_thing;
+#endif
+
 \end{code}
 
 Also include the RTS types for the runtime system modules.