This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] objective-c++, C++ exceptions, and objc_msgsend
David Ayers schrieb:
> Andrew Pinski schrieb:
>
>>On Oct 21, 2005, at 4:35 PM, David Ayers wrote:
>>
>>
>>>Indeed, but how about this... OK to commit?
>>
>>
>>This looks good to me. In fact now this works on pure
>>darwin also.
>>
>
>
> Committed.
Actually I worked much to hard. All that was needed is a simplified
Object interface declaration.
Normally I wouldn't care but for future reference for similar cases I
thought I'd commit this as obvious after testing.
Cheers,
David
2005-10-22 David Ayers <d.ayers@inode.at>
* obj-c++.dg/except-1.mm: Simplify.
Index: gcc/testsuite/obj-c++.dg/except-1.mm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/obj-c++.dg/except-1.mm,v
retrieving revision 1.2
diff -u -r1.2 except-1.mm
--- gcc/testsuite/obj-c++.dg/except-1.mm 21 Oct 2005 21:27:08 -0000 1.2
+++ gcc/testsuite/obj-c++.dg/except-1.mm 22 Oct 2005 09:21:16 -0000
@@ -9,27 +9,16 @@
#include <stdio.h>
#include <stdlib.h>
-#ifndef __NEXT_RUNTIME__
-extern "C" {
- extern id class_create_instance(Class _class);
-}
-#else
-extern "C" {
- extern id (*_zoneAlloc)(Class, unsigned int, void *);
- extern void *malloc_default_zone(void);
-}
-#endif
-@interface RObject {
+@interface Object {
Class isa;
}
-+ initialize;
+ alloc;
- init;
@end
// ObjectiveC class header
-@interface ObjCclass : RObject {
+@interface ObjCclass : Object {
}
-(void)method1;
-(void)method2;
@@ -80,24 +69,3 @@
/* Shouldn't be here because we threw. */
abort ();
}
-
-@implementation RObject
-+ initialize
-{
- return self;
-}
-
-- init
-{
- return self;
-}
-
-+ alloc
-{
-#ifndef __NEXT_RUNTIME__
- return class_create_instance(self);
-#else
- return (*_zoneAlloc)((Class)self, 0, malloc_default_zone());
-#endif
-}
-@end
- References:
- objective-c++, C++ exceptions, and objc_msgsend
- Re: objective-c++, C++ exceptions, and objc_msgsend
- Re: objective-c++, C++ exceptions, and objc_msgsend
- [RFA] objective-c++, C++ exceptions, and objc_msgsend
- Re: [RFA] objective-c++, C++ exceptions, and objc_msgsend
- Re: [RFA] objective-c++, C++ exceptions, and objc_msgsend