o quick fixes for NeXT_Foundation from Philip Moetteli <Philip.Moetteli@tele2.ch>

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18204 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2003-11-25 17:32:29 +00:00
parent d5a191da00
commit 53601d4c23

View file

@ -907,6 +907,14 @@ NSString* MessageForMutexLockError(int errorNo)
-(BOOL)isLocked -(BOOL)isLocked
{ {
BOOL isLocked=YES; BOOL isLocked=YES;
//TODO
#ifdef NeXT_Foundation_LIBRARY
if ([self tmptryLock])
{
isLocked = NO;
[self tmpunlock];
}
#else
if (!_mutex->owner) if (!_mutex->owner)
isLocked=NO; isLocked=NO;
else else
@ -928,6 +936,7 @@ NSString* MessageForMutexLockError(int errorNo)
(void*)objc_thread_id()); (void*)objc_thread_id());
}; };
*/ */
#endif
return isLocked; return isLocked;
}; };
@ -945,6 +954,10 @@ NSString* MessageForMutexLockError(int errorNo)
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self tryLock];
#else
BOOL locked=NO; BOOL locked=NO;
int result=0; int result=0;
// LOGObjectFnStart(); // LOGObjectFnStart();
@ -978,6 +991,7 @@ NSString* MessageForMutexLockError(int errorNo)
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -993,6 +1007,10 @@ NSString* MessageForMutexLockError(int errorNo)
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self tryLock];
#else
BOOL locked=NO; BOOL locked=NO;
int result=0; int result=0;
// LOGObjectFnStart(); // LOGObjectFnStart();
@ -1008,6 +1026,7 @@ NSString* MessageForMutexLockError(int errorNo)
// LOGObjectFnStop(); // LOGObjectFnStop();
}; };
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1025,6 +1044,10 @@ NSString* MessageForMutexLockError(int errorNo)
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self lockBeforeDate:limit];
#else
BOOL locked=NO; BOOL locked=NO;
int result=0; int result=0;
int tryCount=0; int tryCount=0;
@ -1084,6 +1107,7 @@ NSString* MessageForMutexLockError(int errorNo)
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1101,6 +1125,10 @@ NSString* MessageForMutexLockError(int errorNo)
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self lockBeforeDate:limit];
#else
BOOL locked=NO; BOOL locked=NO;
int result=0; int result=0;
int tryCount=0; int tryCount=0;
@ -1167,6 +1195,7 @@ NSString* MessageForMutexLockError(int errorNo)
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1182,6 +1211,10 @@ NSString* MessageForMutexLockError(int errorNo)
file:(const char*)file file:(const char*)file
line:(int)line; line:(int)line;
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
[self unlock];
#else
int result=0; int result=0;
// LOGObjectFnStart(); // LOGObjectFnStart();
NSDebugMLLog(@"low",@"BEF self=%p _mutex=%p _mutex->owner=%p _mutex->depth=%d objc_thread_id()=%p", NSDebugMLLog(@"low",@"BEF self=%p _mutex=%p _mutex->owner=%p _mutex->depth=%d objc_thread_id()=%p",
@ -1236,6 +1269,7 @@ NSString* MessageForMutexLockError(int errorNo)
}; };
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
#endif
}; };
@end @end
@ -1277,6 +1311,10 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self tryLock];
#else
BOOL locked=NO; BOOL locked=NO;
int result=0; int result=0;
// LOGObjectFnStart(); // LOGObjectFnStart();
@ -1319,6 +1357,7 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
// NSDebugMLLog(@"low",@"locked=%d",(int)locked); // NSDebugMLLog(@"low",@"locked=%d",(int)locked);
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1335,6 +1374,10 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self tryLock];
#else
BOOL locked=NO; BOOL locked=NO;
int result=0; int result=0;
// LOGObjectFnStart(); // LOGObjectFnStart();
@ -1355,6 +1398,7 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
// NSDebugMLLog(@"low",@"locked=%d",(int)locked); // NSDebugMLLog(@"low",@"locked=%d",(int)locked);
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1372,6 +1416,10 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self lockBeforeDate:limit];
#else
BOOL locked=NO; BOOL locked=NO;
BOOL notOwner=NO; BOOL notOwner=NO;
int tryCount=0; int tryCount=0;
@ -1431,6 +1479,7 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1448,6 +1497,10 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
file:(const char*)file file:(const char*)file
line:(int)line line:(int)line
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
return [self lockBeforeDate:limit];
#else
BOOL locked=NO; BOOL locked=NO;
BOOL notOwner=NO; BOOL notOwner=NO;
int tryCount=0; int tryCount=0;
@ -1520,6 +1573,7 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
return locked; return locked;
#endif
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1535,6 +1589,10 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
file:(const char*)file file:(const char*)file
line:(int)line; line:(int)line;
{ {
//TODO
#ifdef NeXT_Foundation_LIBRARY
[self unlock];
#else
int result=0; int result=0;
// LOGObjectFnStart(); // LOGObjectFnStart();
// NSDebugMLLog(@"low",@"BEF _mutex->owner=%p _mutex->depth=%d objc_thread_id()=%p",(void*)_mutex->owner,(int)_mutex->depth,(void*)objc_thread_id()); // NSDebugMLLog(@"low",@"BEF _mutex->owner=%p _mutex->depth=%d objc_thread_id()=%p",(void*)_mutex->owner,(int)_mutex->depth,(void*)objc_thread_id());
@ -1569,6 +1627,7 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
}; };
}; };
// LOGObjectFnStop(); // LOGObjectFnStop();
#endif
}; };
@end @end
@ -1855,6 +1914,8 @@ NSString* GSWGetDefaultDocRoot()
@end @end
//==================================================================== //====================================================================
//TODO
#ifndef NeXT_Foundation_LIBRARY
@implementation NSUserDefaults (Description) @implementation NSUserDefaults (Description)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1872,6 +1933,7 @@ NSString* GSWGetDefaultDocRoot()
}; };
@end @end
#endif
//==================================================================== //====================================================================
@implementation NSDictionary (FromNSArray) @implementation NSDictionary (FromNSArray)
@ -2299,7 +2361,7 @@ NSString* GSWGetDefaultDocRoot()
@end @end
#include <Foundation/GSMime.h> #include <GNUstepBase/GSMime.h>
@implementation NSData (Base64) @implementation NSData (Base64)