update method types macro

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27935 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-02-21 08:55:38 +00:00
parent dffa844f2b
commit 18d114ec9a

View file

@ -19,11 +19,15 @@
#define MFRAME_ARGS int #define MFRAME_ARGS int
/*
#define MFRAME_INIT_ARGS(CUM, RTYPE) \ #define MFRAME_INIT_ARGS(CUM, RTYPE) \
((CUM) = ((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || \ ((CUM) = ((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || \
*(RTYPE)==_C_ARY_B) && \ *(RTYPE)==_C_ARY_B) && \
objc_sizeof_type(RTYPE) > MFRAME_SMALL_STRUCT) \ objc_sizeof_type(RTYPE) > MFRAME_SMALL_STRUCT) \
? sizeof(void*) : 0) ? sizeof(void*) : 0)
*/
#define MFRAME_INIT_ARGS(CUM, RTYPE) ((CUM) = 0)
#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \ #define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \
({ \ ({ \
@ -31,30 +35,28 @@
int align = objc_alignof_type(type); \ int align = objc_alignof_type(type); \
int size = objc_sizeof_type(type); \ int size = objc_sizeof_type(type); \
\ \
(CUM) = ROUND((CUM), align); \
(TYPE) = objc_skip_typespec(type); \ (TYPE) = objc_skip_typespec(type); \
sprintf((DEST), "%.*s%d", (int)((TYPE)-type), type, (CUM)); \ (CUM) = ROUND((CUM), __alignof__(int)); \
if (*(TYPE) == '+') \ sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \
{ \ if (*(TYPE) == '+') (TYPE)++; \
(TYPE)++; \ if (*(TYPE) == '-') (TYPE)++; \
} \
if (*(TYPE) == '-') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \ while (isdigit(*(TYPE))) \
{ \ { \
(TYPE)++; \ (TYPE)++; \
} \ } \
(DEST)=&(DEST)[strlen(DEST)]; \ (DEST)=&(DEST)[strlen(DEST)]; \
if ((*type==_C_STRUCT_B || *type==_C_UNION_B || *type==_C_ARY_B)) \ if ((*type==_C_STRUCT_B||*type==_C_UNION_B||*type==_C_ARY_B)) \
{ \ { \
(STACK) = (CUM) + ROUND(size, align); \ (STACK) = (CUM) + ROUND(size, align); \
} \ } \
else \ else \
{ \ { \
if (size < sizeof(int)) \
{ \
size = sizeof(int); \
} \
(STACK) = (CUM) + size; \ (STACK) = (CUM) + size; \
} \ } \
(CUM) += ROUND(size, sizeof(void*)); \ (CUM) += size; \
}) })