Fix type encoding of blocks.

main
theraven 15 years ago
parent 6d50cdee99
commit daf9976eab

@ -161,8 +161,19 @@ static const char *sizeof_type(const char *type, size_t *size)
*size += (sizeof(typeName) * 8);\
return type + 1;\
}
#define SKIP_ID 1
#define NON_INTEGER_TYPES 1
#include "type_encoding_cases.h"
case '@':
{
round_up(size, (alignof(id) * 8));
*size += (sizeof(id) * 8);
if (*(type+1) == '?')
{
type++;
}
return type + 1;
}
case '?':
case 'v': return type+1;
case 'j':
@ -252,7 +263,17 @@ static const char *alignof_type(const char *type, size_t *align)
return type + 1;\
}
#define NON_INTEGER_TYPES 1
#define SKIP_ID 1
#include "type_encoding_cases.h"
case '@':
{
*align = max((alignof(id) * 8), *align);\
if (*(type+1) == '?')
{
type++;
}
return type + 1;
}
case '?':
case 'v': return type+1;
case 'j':

@ -25,7 +25,9 @@ APPLY_TYPE(unsigned long long, unsignedLongLong, UnsignedLongLong, 'Q')
#ifdef NON_INTEGER_TYPES
#undef NON_INTEGER_TYPES
APPLY_TYPE(_Bool, bool, Bool, 'B')
#ifndef SKIP_ID
APPLY_TYPE(id, object, Object, '@')
#endif
APPLY_TYPE(Class, class, Class, '#')
APPLY_TYPE(SEL, selector, Selector, ':')
APPLY_TYPE(char*, cString, CString, '*')

Loading…
Cancel
Save