Add exceptions for MacOS-X compatibility.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26325 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-03-17 05:45:55 +00:00
parent 3c69a9c73b
commit a1063bfa3e
6 changed files with 78 additions and 41 deletions

View file

@ -1,3 +1,12 @@
2008-03-17 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPort.m:
* Source/NSException.m:
* Source/NSConnection.m:
* Headers/Foundation/NSException.h:
* Headers/Foundation/NSPort.h:
Update exceptions to match those in MacOS-X for compatibility.
2008-03-16 Matt Rice <ratmice@gmail.com>
* Source/NSException.m: Add NSObjectNotAvailableException.

View file

@ -161,53 +161,79 @@ extern "C" {
@end
/**
* A generic exception for general purpose usage.
/** An exception when character set conversion fails.
*/
GS_EXPORT NSString* const NSCharacterConversionException;
/** Attempt to use an invalidated destination.
*/
GS_EXPORT NSString* const NSDestinationInvalidException;
/** A generic exception for general purpose usage.
*/
GS_EXPORT NSString* const NSGenericException;
/**
* An exception for cases where unexpected state is detected within an object.
/** An exception for cases where unexpected state is detected within an object.
*/
GS_EXPORT NSString* const NSInternalInconsistencyException;
/**
* An exception used when an invalid argument is passed to a method
/** An exception used when an invalid argument is passed to a method
* or function.
*/
GS_EXPORT NSString* const NSInvalidArgumentException;
/**
* An exception used when the system fails to allocate required memory.
/** Attempt to use a receive port which has been invalidated.
*/
GS_EXPORT NSString * const NSInvalidReceivePortException;
/** Attempt to use a send port which has been invalidated.
*/
GS_EXPORT NSString * const NSInvalidSendPortException;
/** An exception used when the system fails to allocate required memory.
*/
GS_EXPORT NSString* const NSMallocException;
/**
* An exception used when an illegal range is encountered ... usually this
* is used to provide more information than an invalid argument exception.
*/
GS_EXPORT NSString* const NSRangeException;
/**
* An exception when character set conversion fails.
*/
GS_EXPORT NSString* const NSCharacterConversionException;
/**
* An exception when a remote object is sent a message from a thread
/** An exception when a remote object is sent a message from a thread
* unable to access the object.
*/
GS_EXPORT NSString* const NSObjectInaccessibleException;
/** Attempt to send to an object which is no longer available.
*/
GS_EXPORT NSString* const NSObjectNotAvailableException;
/** UNused ... for MacOS-X compatibility.
*/
GS_EXPORT NSString* const NSOldStyleException;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
/**
* An exception used when some form of parsing fails.
/** An exception used when some form of parsing fails.
*/
GS_EXPORT NSString* const NSParseErrorException;
#endif
/** Some failure to receive on a port.
*/
GS_EXPORT NSString * const NSPortReceiveException;
/** Some failure to send on a port.
*/
GS_EXPORT NSString * const NSPortSendException;
/**
* Exception raised by [NSPort], [NSConnection], and friends if sufficient
* time elapses while waiting for a response, or if the receiving port is
* invalidated before a request can be received. See
* [NSConnection-setReplyTimeout:].
*/
GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */
/** An exception used when an illegal range is encountered ... usually this
* is used to provide more information than an invalid argument exception.
*/
GS_EXPORT NSString* const NSRangeException;
/**
* The actual structure for an NSHandler. You shouldn't need to worry about it.
*/

View file

@ -61,14 +61,6 @@ extern "C" {
- (void) handlePortMessage: (NSPortMessage*)aMessage;
@end
/**
* Exception raised by [NSPort], [NSConnection], and friends if sufficient
* time elapses while waiting for a response, or if the receiving port is
* invalidated before a request can be received. See
* [NSConnection-setReplyTimeout:].
*/
GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */
/**
* <p><code>NSPort</code> is an abstract class defining interfaces underlying
* communications in the distributed objects framework. Each side of a

View file

@ -109,6 +109,8 @@ extern NSRunLoop *GSRunLoopForThread(NSThread*);
#define M_LOCK(X) {NSDebugMLLog(@"GSConnection",@"Lock %@",X);[X lock];}
#define M_UNLOCK(X) {NSDebugMLLog(@"GSConnection",@"Unlock %@",X);[X unlock];}
NSString * const NSDestinationInvalidException =
@"NSDestinationInvalidException";
NSString * const NSFailedAuthenticationException =
@"NSFailedAuthenticationExceptions";
NSString * const NSObjectInaccessibleException =

View file

@ -656,6 +656,9 @@ GSListModules()
@end
NSString* const NSCharacterConversionException
= @"NSCharacterConversionException";
NSString* const NSGenericException
= @"NSGenericException";
@ -668,15 +671,15 @@ NSString* const NSInvalidArgumentException
NSString* const NSMallocException
= @"NSMallocException";
NSString* const NSRangeException
= @"NSRangeException";
NSString* const NSCharacterConversionException
= @"NSCharacterConversionException";
NSString* const NSOldStyleException
= @"NSOldStyleException";
NSString* const NSParseErrorException
= @"NSParseErrorException";
NSString* const NSRangeException
= @"NSRangeException";
static void _terminate()
{
BOOL shouldAbort;

View file

@ -49,11 +49,16 @@
@implementation NSPort
/**
* Exception raised if a timeout occurs during a port send or receive
* operation.
*/
NSString * const NSPortTimeoutException = @"NSPortTimeoutException";
NSString * const NSInvalidReceivePortException
= @"NSInvalidReceivePortException";
NSString * const NSInvalidSendPortException
= @"NSInvalidSendPortException";
NSString * const NSPortReceiveException
= @"NSPortReceiveException";
NSString * const NSPortSendException
= @"NSPortSendException";
NSString * const NSPortTimeoutException
= @"NSPortTimeoutException";
static Class NSPort_abstract_class;
static Class NSPort_concrete_class;