#ifndef MPLIB1_DATA_ALIGN #define MPLIB1_DATA_ALIGN /* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source$ * $Author$ * $Date$ * $Revision$ * ******************************************************************************* * * Change History * * $Log$ * ******************************************************************************* */ #ident "$Header$" /* ------------------------------------------------------------------ Include files ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ /** ** Here we attempt to specify what the data alignment rules are ** for a particular platform. ** Two types of alignment are specified, compact and optimal ** This is provided so that the storage vs speed choice can be made ** */ #ifdef EIGHT_ALIGN_EIGHT #define MPLIB_ALIGN_SPC_CHAR 1 #define MPLIB_ALIGN_SPC_SHORT 2 #define MPLIB_ALIGN_SPC_INT 4 #define MPLIB_ALIGN_SPC_LONG 4 #define MPLIB_ALIGN_SPC_DOUBLE 8 #define MPLIB_ALIGN_SPC_VLONG 8 #define MPLIB_ALIGN_SPC_PTR 4 #define MPLIB_STRUCT_PAD 8 #define MPLIB_ALIGN_SPD_CHAR 1 #define MPLIB_ALIGN_SPD_SHORT 2 #define MPLIB_ALIGN_SPD_INT 4 #define MPLIB_ALIGN_SPD_LONG 4 #define MPLIB_ALIGN_SPD_DOUBLE 8 #define MPLIB_ALIGN_SPD_VLONG 8 #define MPLIB_ALIGN_SPD_PTR 4 #else #define MPLIB_ALIGN_SPC_CHAR 1 #define MPLIB_ALIGN_SPC_SHORT 2 #define MPLIB_ALIGN_SPC_INT 4 #define MPLIB_ALIGN_SPC_LONG 4 #define MPLIB_ALIGN_SPC_DOUBLE 4 #define MPLIB_ALIGN_SPC_VLONG 4 #define MPLIB_ALIGN_SPC_PTR 4 #define MPLIB_STRUCT_PAD 4 #define MPLIB_ALIGN_SPD_CHAR 1 #define MPLIB_ALIGN_SPD_SHORT 2 #define MPLIB_ALIGN_SPD_INT 4 #define MPLIB_ALIGN_SPD_LONG 4 #define MPLIB_ALIGN_SPD_DOUBLE 4 #define MPLIB_ALIGN_SPD_VLONG 4 #define MPLIB_ALIGN_SPD_PTR 4 #endif #define STRUCT_PAD(n) (((n)+(MPLIB_STRUCT_PAD-1)) & ~(MPLIB_STRUCT_PAD-1)) /* ------------------------------------------------------------------ structure ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ function definitions ------------------------------------------------------------------ */ #endif /* -- End of File -- */