This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA] ObjC testsuite use simple NSConstantString implementation
- From: David Ayers <d dot ayers at inode dot at>
- To: "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 03 Jun 2004 19:25:45 +0200
- Subject: [RFA] ObjC testsuite use simple NSConstantString implementation
Hello,
this is supplies the testsuite with a simple NSConstantString
implementation to be used for the Apple ObjC runtime tests. This is an
alternative patch in reference to the following thread:
http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00130.html
Andrew Pinski has offered to test these on Darwin for me. His post will
follow.
If approved please apply as I don't have write privileges.
Cheers,
David Ayers
/* This file was derived from the GNU runtimes
NXConstantString implementation. */
#include "objc/Object.h"
@interface NSConstantString: Object
{
char *c_string;
unsigned int len;
}
-(const char *) cString;
-(unsigned int) length;
@end
@implementation NSConstantString
-(const char *) cString
{
return (c_string);
}
-(unsigned int) length
{
return (len);
}
@end
? gcc/testsuite/objc/execute/nsconstantstring.h
Index: gcc/testsuite/objc/execute/string1.m
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/objc/execute/string1.m,v
retrieving revision 1.3
diff -u -r1.3 string1.m
--- gcc/testsuite/objc/execute/string1.m 25 Sep 2003 01:26:00 -0000 1.3
+++ gcc/testsuite/objc/execute/string1.m 3 Jun 2004 13:01:58 -0000
@@ -4,7 +4,7 @@
#include <stdlib.h>
#ifdef __NEXT_RUNTIME__
-#import <Foundation/NSString.h>
+#include "nsconstantstring.h"
#else
#include <objc/NXConstStr.h>
#endif
Index: gcc/testsuite/objc/execute/string2.m
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/objc/execute/string2.m,v
retrieving revision 1.3
diff -u -r1.3 string2.m
--- gcc/testsuite/objc/execute/string2.m 25 Sep 2003 01:26:00 -0000 1.3
+++ gcc/testsuite/objc/execute/string2.m 3 Jun 2004 13:01:58 -0000
@@ -4,7 +4,7 @@
#include <stdlib.h>
#ifdef __NEXT_RUNTIME__
-#import <Foundation/NSString.h>
+#include "nsconstantstring.h"
#else
#include <objc/NXConstStr.h>
#endif
Index: gcc/testsuite/objc/execute/string3.m
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/objc/execute/string3.m,v
retrieving revision 1.2
diff -u -r1.2 string3.m
--- gcc/testsuite/objc/execute/string3.m 25 Sep 2003 01:26:00 -0000 1.2
+++ gcc/testsuite/objc/execute/string3.m 3 Jun 2004 13:01:58 -0000
@@ -4,7 +4,7 @@
#include <stdlib.h>
#ifdef __NEXT_RUNTIME__
-#import <Foundation/NSString.h>
+#include "nsconstantstring.h"
#else
#include <objc/NXConstStr.h>
#endif
Index: gcc/testsuite/objc/execute/string4.m
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/objc/execute/string4.m,v
retrieving revision 1.2
diff -u -r1.2 string4.m
--- gcc/testsuite/objc/execute/string4.m 25 Sep 2003 01:26:00 -0000 1.2
+++ gcc/testsuite/objc/execute/string4.m 3 Jun 2004 13:01:58 -0000
@@ -4,7 +4,7 @@
#include <stdlib.h>
#ifdef __NEXT_RUNTIME__
-#import <Foundation/NSString.h>
+#include "nsconstantstring.h"
#else
#include <objc/NXConstStr.h>
#endif