re PR libobjc/25346 (objc_sizeof_type does not handle _Bool at all)

2005-12-11  Andrew Pinski  <pinskia@physics.uc.edu>

        PR libobjc/25346
        * objc/objc-api.h (_C_BOOL): New define.
        * encoding.c (objc_sizeof_type): Handle _C_BOOL.
        (objc_alignof_type): Likewise.
        (objc_skip_typespec): Likewise.

2005-12-11  Andrew Pinski  <pinskia@physics.uc.edu>

        PR libobjc/25346
        * objc.dg/encode-7.m: New test.

From-SVN: r108378
This commit is contained in:
Andrew Pinski 2005-12-11 06:28:35 +00:00 committed by Andrew Pinski
parent b91365538a
commit 153b4898d2
5 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-12-11 Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/25346
* objc.dg/encode-7.m: New test.
2005-12-10 Mark Mitchell <mark@codesourcery.com>
PR c++/25010

View File

@ -0,0 +1,18 @@
/* { dg-options "-fgnu-runtime" } */
/* { dg-do run } */
#include <objc/encoding.h>
#include <stdlib.h>
struct f
{
_Bool a;
};
int main(void)
{
if (objc_sizeof_type (@encode (struct f)) != sizeof(struct f))
abort ();
return 0;
}

View File

@ -1,3 +1,11 @@
2005-12-11 Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/25346
* objc/objc-api.h (_C_BOOL): New define.
* encoding.c (objc_sizeof_type): Handle _C_BOOL.
(objc_alignof_type): Likewise.
(objc_skip_typespec): Likewise.
2005-11-20 David Ayers <d.ayers@inode.at>
PR libobjc/19024

View File

@ -123,6 +123,10 @@ objc_sizeof_type (const char *type)
}
switch (*type) {
case _C_BOOL:
return sizeof (_Bool);
break;
case _C_ID:
return sizeof (id);
break;
@ -273,6 +277,10 @@ objc_alignof_type (const char *type)
/* do nothing */;
}
switch (*type) {
case _C_BOOL:
return __alignof__ (_Bool);
break;
case _C_ID:
return __alignof__ (id);
break;
@ -496,6 +504,7 @@ objc_skip_typespec (const char *type)
case _C_INT:
case _C_UINT:
case _C_LNG:
case _C_BOOL:
case _C_ULNG:
case _C_LNG_LNG:
case _C_ULNG_LNG:

View File

@ -69,6 +69,7 @@ struct objc_method_description
#define _C_FLT 'f'
#define _C_DBL 'd'
#define _C_BFLD 'b'
#define _C_BOOL 'B'
#define _C_VOID 'v'
#define _C_UNDEF '?'
#define _C_PTR '^'