[RFA] ObjC testsuite use simple NSConstantString implementation
Ziemowit Laski
zlaski@apple.com
Thu Jun 3 21:13:00 GMT 2004
On 3 Jun, 2004, at 10.25, David Ayers wrote:
> 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
I must apologize for not being aware that the Darwin distribution
indeed does not bundle Foundation with it. :-)
Would conditionalizing '-framework Foundation' on '--disable-libobjc'
(_and_ Darwinness, of course) be a good compromise?
--Zem
>
> 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
>
>
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477
More information about the Gcc-patches
mailing list