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:
Richard Frith-MacDonald 2009-02-21 08:55:38 +00:00
parent 0e72adc170
commit 62947809ff

View file

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