From 4266041d7f0119f77693812da10ed933fb1d8807 Mon Sep 17 00:00:00 2001 From: panne Date: Tue, 25 Jan 2000 14:39:14 +0000 Subject: [PATCH] [project @ 2000-01-25 14:39:14 by panne] Added a bunch of #defines for {SIZEOF,ALIGNMENT}_{INT,WORD}{8,16,32,64}. All this is a real hack: The include files need a more thorough restructuring. --- ghc/includes/MachDeps.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/ghc/includes/MachDeps.h b/ghc/includes/MachDeps.h index eb8b6d7..48c54e8 100644 --- a/ghc/includes/MachDeps.h +++ b/ghc/includes/MachDeps.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: MachDeps.h,v 1.3 1999/02/05 16:02:23 simonm Exp $ + * $Id: MachDeps.h,v 1.4 2000/01/25 14:39:14 panne Exp $ * * (c) The GRASP/AQUA Project, Glasgow University, 1998 * (c) The GHC Team, 1998-1999 @@ -29,4 +29,38 @@ #define DOUBLE_SIZE_IN_BYTES SIZEOF_DOUBLE #endif +#define SIZEOF_INT8 SIZEOF_CHAR +#define ALIGNMENT_INT8 ALIGNMENT_CHAR +#define SIZEOF_WORD8 SIZEOF_UNSIGNED_CHAR +#define ALIGNMENT_WORD8 ALIGNMENT_UNSIGNED_CHAR + +#define SIZEOF_INT16 SIZEOF_SHORT +#define ALIGNMENT_INT16 ALIGNMENT_SHORT +#define SIZEOF_WORD16 SIZEOF_UNSIGNED_SHORT +#define ALIGNMENT_WORD16 ALIGNMENT_UNSIGNED_SHORT + +#if SIZEOF_UNSIGNED_INT == 4 +#define SIZEOF_INT32 ALIGNMENT_INT +#define ALIGNMENT_INT32 SIZEOF_INT +#define SIZEOF_WORD32 ALIGNMENT_UNSIGNED_INT +#define ALIGNMENT_WORD32 SIZEOF_UNSIGNED_INT +#else +#error GHC untested on this architecture: sizeof(unsigned int) != 4 +#endif + +#if HAVE_LONG_LONG && SIZEOF_VOID_P < 8 +/* assume long long is 64 bits */ +#define SIZEOF_INT64 SIZEOF_LONG_LONG +#define ALIGNMENT_INT64 ALIGNMENT_LONG_LONG +#define SIZEOF_WORD64 SIZEOF_UNSIGNED_LONG_LONG +#define ALIGNMENT_WORD64 ALIGNMENT_UNSIGNED_LONG_LONG +#elif SIZEOF_LONG == 8 +#define SIZEOF_INT64 SIZEOF_LONG +#define ALIGNMENT_INT64 ALIGNMENT_LONG +#define SIZEOF_WORD64 SIZEOF_UNSIGNED_LONG +#define ALIGNMENT_WORD64 ALIGNMENT_UNSIGNED_LONG +#else +#error GHC untested on this architecture: sizeof(void *) < 8 and no long longs. +#endif + #endif -- 1.7.10.4