diff --git a/ase/awk/rex.c b/ase/awk/rex.c index af849211..91bca6c9 100644 --- a/ase/awk/rex.c +++ b/ase/awk/rex.c @@ -1,5 +1,5 @@ /* - * $Id: rex.c,v 1.62 2007-02-18 13:07:00 bacon Exp $ + * $Id: rex.c,v 1.63 2007-02-18 15:51:07 bacon Exp $ * * {License} */ @@ -53,17 +53,15 @@ typedef struct __builder_t __builder_t; typedef struct __matcher_t __matcher_t; typedef struct __match_t __match_t; -struct __code_t -{ +ASE_BEGIN_PACKED_STRUCT(__code_t) /*ase_byte_t cmd;*/ short cmd; short negate; /* only for CMD_CHARSET */ ase_size_t lbound; ase_size_t ubound; -} __attribute__((packed)); +ASE_END_PACKED_STRUCT() -struct __builder_t -{ +ASE_BEGIN_PACKED_STRUCT(__builder_t) ase_awk_t* awk; struct @@ -92,10 +90,9 @@ struct __builder_t } depth; int errnum; -} __attribute__((packed)); +ASE_END_PACKED_STRUCT() -struct __matcher_t -{ +ASE_BEGIN_PACKED_STRUCT(__matcher_t) ase_awk_t* awk; struct @@ -115,10 +112,9 @@ struct __matcher_t int ignorecase; int errnum; -} __attribute__((packed)); +ASE_END_PACKED_STRUCT() -struct __match_t -{ +ASE_BEGIN_PACKED_STRUCT(__match_t) const ase_char_t* match_ptr; ase_bool_t matched; @@ -126,7 +122,7 @@ struct __match_t const ase_byte_t* branch; const ase_byte_t* branch_end; -} __attribute__((packed)); +ASE_END_PACKED_STRUCT() typedef const ase_byte_t* (*atom_matcher_t) ( __matcher_t* matcher, const ase_byte_t* base, __match_t* mat); diff --git a/ase/macros.h b/ase/macros.h index bb50e289..20fece01 100644 --- a/ase/macros.h +++ b/ase/macros.h @@ -1,5 +1,5 @@ /* - * $Id: macros.h,v 1.47 2007-02-18 15:09:19 bacon Exp $ + * $Id: macros.h,v 1.48 2007-02-18 15:51:07 bacon Exp $ * * {License} */ @@ -90,10 +90,13 @@ #if defined(__GNUC__) #define ASE_BEGIN_PACKED_STRUCT(x) struct x { - #define ASE_END_PACKED_STRUCT() } __attribute__((packed)) + #define ASE_END_PACKED_STRUCT() } __attribute__((packed)); +#elif defined(__HP_aCC) || defined(__HP_cc) + #define ASE_BEGIN_PACKED_STRUCT(x) struct x { + #define ASE_END_PACKED_STRUCT() } __attribute__((packed)); #else - #define ASE_BEGIN_PAcKED_STRUCT(x) struct x { - #define AES_END_PACKED_STRUCT() } + #define ASE_BEGIN_PACKED_STRUCT(x) struct x { + #define ASE_END_PACKED_STRUCT() }; #endif #endif diff --git a/ase/pack.h b/ase/pack.h new file mode 100644 index 00000000..7d368e1f --- /dev/null +++ b/ase/pack.h @@ -0,0 +1,11 @@ +/* + * $Id: pack.h,v 1.1 2007-02-18 15:51:07 bacon Exp $ + * + * {License} + */ + +#if defined(__GNUC__) +#pragma pack(push,1) +#elif defined(__HP_aCC) || defined(__HP_cc) +#pragma pack(1) +#endif diff --git a/ase/unpack.h b/ase/unpack.h new file mode 100644 index 00000000..c25881ca --- /dev/null +++ b/ase/unpack.h @@ -0,0 +1,11 @@ +/* + * $Id: unpack.h,v 1.1 2007-02-18 15:51:07 bacon Exp $ + * + * {License} + */ + +#if defined(__GNUC__) +#pragma pack(pop) +#elif defined(__HP_aCC) || defined(__HP_cc) +#pragma pack +#endif