* Headers/Additions/GNUstepBase/GSCategories.h: Move

declarations
	from Source/Additions/GSCompatibility.h to here.
	([NSObject -compare:]): Deprecate.
	* Source/Additions/GSCompatibility.h: Move contents from here
	to
	Headers/Additions/GNUstepBase/GSCategories.h.

	* Source/Additions/GSCategories.m:
	([NSObject -compare:]): Deprecate.

	* Headers/Foundation/NSObject.h
	([NSObject -compare:]): Deprecate.

	* Source/Additions/GCDictionary.m: Include
	GNUstepBase/GSCategories.h rather than GSCompatibility.h.
	* Source/Additions/GCObject.m: Ditto.
	* Source/Additions/GSMime.m: Ditto.
	* Source/Additions/GSObjCRuntime.m: Ditto.
	* Source/Additions/GSXML.m: Ditto.
	* Source/Additions/Unicode.m: Ditto.

	* macosx/GNUstepBase/preface.h: Update include for new header
	structure.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17664 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2003-09-13 22:42:50 +00:00
parent a126c61660
commit adf139cf68
13 changed files with 290 additions and 239 deletions

View file

@ -25,7 +25,6 @@
#include <string.h>
#include <Foundation/Foundation.h>
#include "GNUstepBase/GSCategories.h"
#include "GSCompatibility.h"
/**
* Extension methods for the NSCalendarDate class
@ -570,11 +569,19 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
}
/**
* Compare the receiver with anObject to see which is greater.
* The default implementation orders by memory location.
* WARNING: The -compare: method for NSObject is deprecated
* due to subclasses declaring the same selector with
* conflicting signatures.
* Comparision of arbitrary objects is not just meaningless
* but also dangerous as most concrete implementations
* expect comparable objects as arguments often accessing
* instance variables directly.
* This method will be removed in a future release.
*/
- (int) compare: (id)anObject
- (NSComparisonResult) compare: (id)anObject
{
NSLog(@"WARNING: The -compare: method for NSObject is deprecated.");
if (anObject == self)
{
return NSOrderedSame;
@ -582,21 +589,21 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
if (anObject == nil)
{
[NSException raise: NSInvalidArgumentException
format: @"nil argument for compare:"];
format: @"nil argument for compare:"];
}
if ([self isEqual: anObject])
{
return NSOrderedSame;
}
/*
* Ordering objects by their address is pretty useless,
* Ordering objects by their address is pretty useless,
* so subclasses should override this is some useful way.
*/
if (self > anObject)
{
return NSOrderedDescending;
}
else
else
{
return NSOrderedAscending;
}