+-- Define a fixed-range integral type equivalent to the target Int/Word
+
+#if SIZEOF_HSWORD == 4
+type TargetInt = Int32
+type TargetWord = Word32
+#elif SIZEOF_HSWORD == 8
+type TargetInt = Int64
+type TargetWord = Word64
+#else
+#error unknown SIZEOF_HSWORD
+#endif
+
+tARGET_MIN_INT, tARGET_MAX_INT, tARGET_MAX_WORD :: Integer
+tARGET_MIN_INT = fromIntegral (minBound :: TargetInt)
+tARGET_MAX_INT = fromIntegral (maxBound :: TargetInt)
+tARGET_MAX_WORD = fromIntegral (maxBound :: TargetWord)
+
+tARGET_MAX_CHAR :: Int
+tARGET_MAX_CHAR = 0x10ffff
+