Apple constant string updates

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13097 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-03-12 15:25:37 +00:00
parent 01740b26ec
commit c64fae2564
5 changed files with 32 additions and 16 deletions

View file

@ -1,3 +1,11 @@
2002-03-12 Adam Fedor <fedor@gnu.org>
* Headers/gnustep/base/NSString.h: Add extra ivars needed by Darwin
to NXConstantString.
* Source/GSString.m: ([NXConstantString +initialize]): Remove constant
string class reference setup for Darwin.
* Source/NSProcessInfo.m (main): Put it here.
Tue Mar 12 11:13:51 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Source/Additions/GSXML.m ([-isEqualTo:]): Renamed everywhere to

View file

@ -330,6 +330,15 @@ enum {
*/
@interface NXConstantString : NSString
{
#if defined(__APPLE__) && __GCC__ >= 3
/* Up to gcc 2.95.2 the compiler slipped these two in automatically.
With the advent of ObjC++ this is no longer possible (?).
There is no Apple modified gcc between 2.95.2 and 3.1.
This info ia as of 2002-03-04 and regarding the experimental
Apple gcc 3.1. Markus Hitter, mah@jump-ing.de */
char *cString;
unsigned int len;
#endif
union {
unichar *u;
unsigned char *c;
@ -338,8 +347,9 @@ enum {
}
@end
#if NeXT_RUNTIME
/* For internal use with NeXT runtime. */
#ifdef NeXT_RUNTIME
/* For internal use with NeXT runtime;
needed, until Apple Radar 2870817 is fixed. */
extern struct objc_class _NSConstantStringClassReference;
#endif

View file

@ -52,8 +52,11 @@
#include <base/Unicode.h>
/* Used by the Darwin/NeXT ObjC Runtime */
#ifdef NeXT_RUNTIME
/* Used by the Darwin/NeXT ObjC Runtime
until Apple Radar 2870817 is fixed. */
struct objc_class _NSConstantStringClassReference;
#endif
/*
* GSPlaceholderString - placeholder class for objects awaiting intialisation.
@ -3324,17 +3327,7 @@ transmute(ivars self, NSString *aString)
{
if (self == [NXConstantString class])
{
#if NeXT_RUNTIME
struct objc_class *ref = self;
#endif
behavior_class_add_class(self, [GSCString class]);
#if NeXT_RUNTIME
/* Set up a structure to represent the constant string class. All constant strings point to
this structure.
*/
_NSConstantStringClassReference = *ref;
#endif
}
}

View file

@ -500,6 +500,14 @@ _gnu_noobjc_free_vars(void)
#undef main
int main(int argc, char *argv[], char *env[])
{
#ifdef NeXT_RUNTIME
/* This memcpy has to be done before the first message is sent to any
constant string object. See Apple Radar 2870817 */
memcpy(&_NSConstantStringClassReference,
objc_getClass("NSConstantString"),
sizeof(_NSConstantStringClassReference));
#endif
#if defined(__MINGW__)
WSADATA lpWSAData;

View file

@ -1,9 +1,6 @@
#include <Foundation/NSObject.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSAutoreleasePool.h>
#ifndef _WIN32
#include "malloc.h"
#endif
@interface ReleaseTester : NSObject
{