X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FStgTypes.lh;h=824f56d6f7e8cf604fe40125901e987550adedbc;hb=967cc47f37cb93a5e2b6df7822c9a646f0428247;hp=24783aedda558a41d5a8f3a1f10b0ad238ebb086;hpb=a7e6cdbfc4f27c2e0ab9c12ebe6431c246c74c6d;p=ghc-hetmet.git diff --git a/ghc/includes/StgTypes.lh b/ghc/includes/StgTypes.lh index 24783ae..824f56d 100644 --- a/ghc/includes/StgTypes.lh +++ b/ghc/includes/StgTypes.lh @@ -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.