2010-02-15 09:35:20 +00:00
|
|
|
/* Common information for all objc runtime tests.
|
|
|
|
*/
|
2011-08-17 11:46:06 +00:00
|
|
|
#include <stdlib.h>
|
2010-02-15 09:35:20 +00:00
|
|
|
#include <objc/objc.h>
|
2010-12-22 23:47:12 +00:00
|
|
|
|
|
|
|
#if __GNU_LIBOBJC__
|
|
|
|
# include <objc/runtime.h>
|
|
|
|
# include <objc/message.h>
|
|
|
|
#else
|
|
|
|
# include <objc/objc-api.h>
|
|
|
|
#endif
|
2010-02-15 09:35:20 +00:00
|
|
|
|
|
|
|
#include <objc/Object.h>
|
|
|
|
|
2010-09-09 23:22:46 +00:00
|
|
|
#ifdef __GNUSTEP_RUNTIME__
|
|
|
|
#include <objc/hooks.h>
|
|
|
|
#endif
|
|
|
|
|
2010-12-22 23:47:12 +00:00
|
|
|
/* Provide an implementation of NXConstantString for an old libobjc when
|
|
|
|
built stand-alone without an NXConstantString implementation. */
|
2010-09-09 23:22:46 +00:00
|
|
|
#if !defined(NeXT_RUNTIME) && !defined(__GNUSTEP_RUNTIME__)
|
2010-02-15 09:35:20 +00:00
|
|
|
@implementation NXConstantString
|
|
|
|
- (const char*) cString
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
- (unsigned int) length
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Provide dummy implementations for NSObject and NSConstantString
|
2010-12-22 23:47:12 +00:00
|
|
|
* for libobjc2 which needs them.
|
2010-02-15 09:35:20 +00:00
|
|
|
*/
|
2010-10-16 20:43:33 +00:00
|
|
|
@interface NSObject
|
|
|
|
{
|
2010-09-09 23:22:46 +00:00
|
|
|
id isa;
|
2010-10-16 20:43:33 +00:00
|
|
|
}
|
2010-02-15 09:35:20 +00:00
|
|
|
@end
|
|
|
|
@implementation NSObject
|
2011-02-10 18:54:37 +00:00
|
|
|
+ (id)new
|
|
|
|
{
|
|
|
|
NSObject *obj = calloc(sizeof(id), 1);
|
|
|
|
obj->isa = self;
|
|
|
|
return obj;
|
|
|
|
}
|
2010-02-15 09:35:20 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSConstantString : NSObject
|
|
|
|
@end
|
|
|
|
@implementation NSConstantString
|
|
|
|
@end
|