X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fbin%2Fembryo_cc_amx.h;h=0118e2d2af5e49d337b9416186aab79a4ff90013;hb=b9bf26beb041831a1fdc6e97d268b068e6df3cb0;hp=d5cb64e9bb5b0e9b269e1b378055b401fdb99161;hpb=226c11fd641bb3bdcb28c01b52b19227729878f3;p=framework%2Fuifw%2Fembryo.git diff --git a/src/bin/embryo_cc_amx.h b/src/bin/embryo_cc_amx.h index d5cb64e..0118e2d 100644 --- a/src/bin/embryo_cc_amx.h +++ b/src/bin/embryo_cc_amx.h @@ -21,8 +21,6 @@ * Version: $Id$ */ -#include "embryo_cc_osdefs.h" - #ifndef EMBRYO_CC_AMX_H #define EMBRYO_CC_AMX_H @@ -67,11 +65,20 @@ #define sEXPMAX 19 /* maximum name length for file version <= 6 */ #define sNAMEMAX 31 /* maximum name length of symbol name */ +#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack(1) +# define EMBRYO_STRUCT_PACKED +#elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100) +# define EMBRYO_STRUCT_PACKED __attribute__((packed)) +#else +# define EMBRYO_STRUCT_PACKED +#endif + typedef struct tagAMX_FUNCSTUB { unsigned int address; char name[sEXPMAX + 1]; - } __attribute__((packed)) AMX_FUNCSTUB; + } EMBRYO_STRUCT_PACKED AMX_FUNCSTUB; /* The AMX structure is the internal structure for many functions. Not all * fields are valid at all times; many fields are cached in local variables. @@ -108,7 +115,7 @@ cell reset_stk ; cell reset_hea ; cell *syscall_d; /* relocated value/address for the SYSCALL.D opcode */ - } __attribute__((packed)) AMX; + } EMBRYO_STRUCT_PACKED AMX; /* The AMX_HEADER structure is both the memory format as the file format. The * structure is used internaly. @@ -132,7 +139,12 @@ int pubvars ; /* the "public variables" table */ int tags ; /* the "public tagnames" table */ int nametable ; /* name table, file version 7 only */ - } __attribute__((packed)) AMX_HEADER; + } EMBRYO_STRUCT_PACKED AMX_HEADER; + +#if defined _MSC_VER || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack() +#endif + #define AMX_MAGIC 0xf1e0 enum @@ -206,7 +218,7 @@ amx_GetAddr((amx), (param), &amx_cstr_); \ amx_StrLen(amx_cstr_, &amx_length_); \ if (amx_length_ > 0 && \ - ((result) = (char*)alloca(amx_length_ + 1)) != NULL) \ + ((result) = (char *)alloca(amx_length_ + 1))) \ amx_GetString((result), amx_cstr_); \ else (result) = NULL; \ }