mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-25 03:44:04 +08:00
testsuite, Objective-C : Compatibility fixes.
Changes to deal with warnings and/or errors seen when compiling the tests with clang. gcc/testsuite/ChangeLog: * objc-obj-c++-shared/TestsuiteObject.h: If the compiler supports objc_root_object attributes, then mark the testsuite object accordingly. * objc-obj-c++-shared/TestsuiteObject.m: Avoid direct access to isa, which is an error for modern Objective-C. * objc/execute/class-tests-1.h: Declare a string function we use locally (avoid pulling in the whole of string.h).
This commit is contained in:
parent
8703bf5d31
commit
67f984d62e
@ -24,6 +24,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
/* We use this root class instead of Object to keep the tests
|
||||
independent of the runtime being used. Keep it simple. */
|
||||
|
||||
#if defined(__has_attribute) && __has_attribute(objc_root_class)
|
||||
__attribute__((objc_root_class))
|
||||
#endif
|
||||
@interface TestsuiteObject
|
||||
{
|
||||
Class isa;
|
||||
|
@ -64,6 +64,6 @@ along with GCC; see the file COPYING3. If not see
|
||||
}
|
||||
- (const char *)name
|
||||
{
|
||||
return class_getName (isa);
|
||||
return object_getClassName (self);
|
||||
}
|
||||
@end
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <stdlib.h>
|
||||
#include "../../objc-obj-c++-shared/runtime.h"
|
||||
|
||||
extern int strcmp(const char *, const char *);
|
||||
|
||||
/*
|
||||
* Standard Tests For Classes and Objects - abort upon failing; return
|
||||
* normally if all is well.
|
||||
|
Loading…
Reference in New Issue
Block a user