summaryrefslogtreecommitdiff
path: root/byterun/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/config.h')
-rw-r--r--byterun/config.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/byterun/config.h b/byterun/config.h
index da9612489c..a6a59e9c9d 100644
--- a/byterun/config.h
+++ b/byterun/config.h
@@ -27,29 +27,51 @@
#include "compatibility.h"
#endif
-/* Types for signed chars, 16-bit integers, 32-bit integers, 64-bit integers */
+/* Types for signed chars, 32-bit integers, 64-bit integers,
+ native integers (as wide as a pointer type) */
typedef signed char schar;
-typedef short int16; /* FIXME -- not true on the Cray T3E */
-typedef unsigned short uint16; /* FIXME -- not true on the Cray T3E */
+#if SIZEOF_PTR == SIZEOF_LONG
+/* Standard models: ILP32 or I32LP64 */
+typedef long intnat;
+typedef unsigned long uintnat;
+#define ARCH_INTNAT_PRINTF_FORMAT "l"
+#elif SIZEOF_PTR == SIZEOF_INT
+/* Hypothetical IP32L64 model */
+typedef int intnat;
+typedef unsigned int uintnat;
+#define ARCH_INTNAT_PRINTF_FORMAT ""
+#elif SIZEOF_PTR == 8 && defined(ARCH_INT64_TYPE)
+/* Win64 model: IL32LLP64 */
+typedef ARCH_INT64_TYPE intnat;
+typedef ARCH_UINT64_TYPE uintnat;
+#define ARCH_INTNAT_PRINTF_FORMAT ARCH_INT64_PRINTF_FORMAT
+#else
+#error "No integer type available to represent pointers"
+#endif
#if SIZEOF_INT == 4
typedef int int32;
typedef unsigned int uint32;
+#define ARCH_INT32_PRINTF_FORMAT ""
#elif SIZEOF_LONG == 4
typedef long int32;
typedef unsigned long uint32;
+#define ARCH_INT32_PRINTF_FORMAT "l"
#elif SIZEOF_SHORT == 4
typedef short int32;
typedef unsigned short uint32;
+#define ARCH_INT32_PRINTF_FORMAT ""
+#else
+#error "No 32-bit integer type available"
#endif
#if defined(ARCH_INT64_TYPE)
typedef ARCH_INT64_TYPE int64;
typedef ARCH_UINT64_TYPE uint64;
#else
-# if ARCH_BIG_ENDIAN
+# ifdef ARCH_BIG_ENDIAN
typedef struct { uint32 h, l; } uint64, int64;
# else
typedef struct { uint32 l, h; } uint64, int64;
@@ -85,7 +107,7 @@ typedef struct { uint32 l, h; } uint64, int64;
/* Memory model parameters */
/* The size of a page for memory management (in bytes) is [1 << Page_log].
- It must be a multiple of [sizeof (long)]. */
+ It must be a multiple of [sizeof (value)]. */
#define Page_log 12 /* A page is 4 kilobytes. */
/* Initial size of stack (bytes). */