mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
get code to compile/link again
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35004 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
abb5a4dd3e
commit
cd57095d65
5 changed files with 66 additions and 37 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,11 @@
|
|||
2012-03-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSOperation.m:
|
||||
* Source/NSRegularExpression.m:
|
||||
* Headers/GNUstepBase/GSBlocks.h:
|
||||
* Headers/Foundation/NSOperation.h:
|
||||
Get things compiling/linking again with gcc after blocks changes.
|
||||
|
||||
2012-03-26 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
* Headers/Foundation/NSOperation.h
|
||||
|
@ -8,7 +16,8 @@
|
|||
|
||||
* Source/NSXMLElement.m,
|
||||
* Source/NSXMLNode.m: Better support for namespaces. Corrected
|
||||
-_nodeFollowingInNaturalDirection:, -setStringValue: and -XMLStringWithOptions:
|
||||
-_nodeFollowingInNaturalDirection:, -setStringValue:
|
||||
and -XMLStringWithOptions:
|
||||
|
||||
2012-03-26 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
|
|
|
@ -28,13 +28,17 @@
|
|||
#define __NSOperation_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <GNUstepBase/GSBlocks.h>
|
||||
#if OS_API_VERSION(100500, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(100600, GS_API_LATEST)
|
||||
#import <GNUstepBase/GSBlocks.h>
|
||||
DEFINE_BLOCK_TYPE_NO_ARGS(GSOperationCompletionBlock, void);
|
||||
#endif
|
||||
|
||||
@class NSMutableArray;
|
||||
|
||||
enum {
|
||||
|
@ -78,6 +82,13 @@ typedef NSInteger NSOperationQueuePriority;
|
|||
*/
|
||||
- (void) cancel;
|
||||
|
||||
#if OS_API_VERSION(100600, GS_API_LATEST)
|
||||
/**
|
||||
* Returns the block that will be executed after the operation finishes.
|
||||
*/
|
||||
- (GSOperationCompletionBlock) completionBlock;
|
||||
#endif
|
||||
|
||||
/** Returns all the dependencies of the receiver in the order in which they
|
||||
* were added.
|
||||
*/
|
||||
|
@ -136,6 +147,13 @@ typedef NSInteger NSOperationQueuePriority;
|
|||
*/
|
||||
- (void) removeDependency: (NSOperation *)op;
|
||||
|
||||
#if OS_API_VERSION(100600, GS_API_LATEST)
|
||||
/**
|
||||
* Sets the block that will be executed when the operation has finished.
|
||||
*/
|
||||
- (void) setCompletionBlock: (GSOperationCompletionBlock)aBlock;
|
||||
#endif
|
||||
|
||||
/** Sets the priority for the receiver. If the value supplied is not one of
|
||||
* the predefined queue priorities, it is converted into the next available
|
||||
* defined value moving towards NSOperationQueuePriorityNormal.
|
||||
|
@ -149,14 +167,6 @@ typedef NSInteger NSOperationQueuePriority;
|
|||
* The valid range is 0.0 to 1.0
|
||||
*/
|
||||
- (void) setThreadPriority: (double)prio;
|
||||
|
||||
|
||||
DEFINE_BLOCK_TYPE_NO_ARGS(GSOperationCompletionBlock, void);
|
||||
|
||||
/**
|
||||
* Sets the block that will be executed when the operation has finished.
|
||||
*/
|
||||
- (void)setCompletionBlock: (GSOperationCompletionBlock)aBlock;
|
||||
#endif
|
||||
|
||||
/** This method is called to start execution of the receiver.<br />
|
||||
|
@ -185,11 +195,6 @@ DEFINE_BLOCK_TYPE_NO_ARGS(GSOperationCompletionBlock, void);
|
|||
* from the same thread that the receiver started in.
|
||||
*/
|
||||
- (void) waitUntilFinished;
|
||||
|
||||
/**
|
||||
* Returns the block that will be executed after the operation finishes.
|
||||
*/
|
||||
- (GSOperationCompletionBlock)completionBlock;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
|
@ -88,6 +88,7 @@ typedef retTy(^name)()
|
|||
|
||||
|
||||
#define CALL_BLOCK(block, args...) block->invoke(block, args)
|
||||
#define CALL_BLOCK_NO_ARGS(block) block->invoke(block)
|
||||
#define BLOCK_SCOPE
|
||||
#endif /* GCC_VERSION >= 3000 */
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
BOOL blocked; \
|
||||
BOOL ready; \
|
||||
NSMutableArray *dependencies; \
|
||||
GSOperationCompletionBlock completionBlock
|
||||
GSOperationCompletionBlock completionBlock;
|
||||
|
||||
#define GS_NSOperationQueue_IVARS \
|
||||
NSRecursiveLock *lock; \
|
||||
|
@ -189,6 +189,11 @@ static NSArray *empty = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (GSOperationCompletionBlock) completionBlock
|
||||
{
|
||||
return internal->completionBlock;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
if (internal != nil)
|
||||
|
@ -354,6 +359,12 @@ static NSArray *empty = nil;
|
|||
[internal->lock unlock];
|
||||
}
|
||||
|
||||
- (void) setCompletionBlock: (GSOperationCompletionBlock)aBlock
|
||||
{
|
||||
internal->completionBlock = aBlock;
|
||||
GSPrintf(stderr, @"Setting block: %p", internal->completionBlock);
|
||||
}
|
||||
|
||||
- (void) setQueuePriority: (NSOperationQueuePriority)pri
|
||||
{
|
||||
if (pri <= NSOperationQueuePriorityVeryLow)
|
||||
|
@ -397,18 +408,6 @@ static NSArray *empty = nil;
|
|||
internal->threadPriority = pri;
|
||||
}
|
||||
|
||||
|
||||
- (void) setCompletionBlock:(GSOperationCompletionBlock)aBlock
|
||||
{
|
||||
ASSIGN(internal->completionBlock, aBlock);
|
||||
GSPrintf(stderr, @"Setting block: %p", internal->completionBlock);
|
||||
}
|
||||
|
||||
- (GSOperationCompletionBlock)completionBlock
|
||||
{
|
||||
return internal->completionBlock;
|
||||
}
|
||||
|
||||
- (void) start
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
@ -537,11 +536,11 @@ static NSArray *empty = nil;
|
|||
internal->finished = YES;
|
||||
[self didChangeValueForKey: @"isFinished"];
|
||||
}
|
||||
if (NULL != internal->completionBlock)
|
||||
{
|
||||
GSPrintf(stderr, @"Calling block: %p", internal->completionBlock);
|
||||
CALL_BLOCK_NO_ARGS(internal->completionBlock);
|
||||
}
|
||||
if (NULL != internal->completionBlock)
|
||||
{
|
||||
GSPrintf(stderr, @"Calling block: %p", internal->completionBlock);
|
||||
CALL_BLOCK_NO_ARGS(internal->completionBlock);
|
||||
}
|
||||
}
|
||||
[internal->lock unlock];
|
||||
[self release];
|
||||
|
|
|
@ -102,6 +102,7 @@ NSRegularExpressionOptionsToURegexpFlags(NSRegularExpressionOptions opts)
|
|||
error: e] autorelease];
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_UREGEX_OPENUTEXT
|
||||
- (id) initWithPattern: (NSString*)aPattern
|
||||
options: (NSRegularExpressionOptions)opts
|
||||
|
@ -112,6 +113,13 @@ NSRegularExpressionOptionsToURegexpFlags(NSRegularExpressionOptions opts)
|
|||
UParseError pe = {0};
|
||||
UErrorCode s = 0;
|
||||
|
||||
#if !__has_feature(blocks)
|
||||
if ([self class] != [NSRegularExpression class])
|
||||
{
|
||||
GSOnceMLog(@"Warning: NSRegularExpression was built by a compiler without blocks support. NSRegularExpression will deviate from the documented behaviour when subclassing and any code that subclasses NSRegularExpression may break in unexpected ways. If you must subclass NSRegularExpression, you are strongly recommended to use a compiler with blocks support.");
|
||||
}
|
||||
#endif
|
||||
|
||||
UTextInitWithNSString(&p, aPattern);
|
||||
regex = uregex_openUText(&p, flags, &pe, &s);
|
||||
utext_close(&p);
|
||||
|
@ -151,6 +159,13 @@ NSRegularExpressionOptionsToURegexpFlags(NSRegularExpressionOptions opts)
|
|||
UErrorCode s = 0;
|
||||
TEMP_BUFFER(buffer, length);
|
||||
|
||||
#if !__has_feature(blocks)
|
||||
if ([self class] != [NSRegularExpression class])
|
||||
{
|
||||
GSOnceMLog(@"Warning: NSRegularExpression was built by a compiler without blocks support. NSRegularExpression will deviate from the documented behaviour when subclassing and any code that subclasses NSRegularExpression may break in unexpected ways. If you must subclass NSRegularExpression, you are strongly recommended to use a compiler with blocks support.");
|
||||
}
|
||||
#endif
|
||||
|
||||
[aPattern getCharacters: buffer range: NSMakeRange(0, length)];
|
||||
regex = uregex_open(buffer, length, flags, &pe, &s);
|
||||
if (U_FAILURE(s))
|
||||
|
@ -511,10 +526,10 @@ prepareResult(NSRegularExpression *regex,
|
|||
}
|
||||
|
||||
#else
|
||||
# warning Your compiler does not support blocks. NSRegularExpression will deviate from the documented behaviour when subclassing and any code that subclasses NSRegularExpression may break in unexpected ways. It is strongly recommended that you use a compiler with blocks support.
|
||||
# ifdef __clang__
|
||||
# warning Your compiler would support blocks if you added -fblocks to your OBJCFLAGS
|
||||
# endif
|
||||
# ifdef __clang__
|
||||
# warning Your compiler does not support blocks. NSRegularExpression will deviate from the documented behaviour when subclassing and any code that subclasses NSRegularExpression may break in unexpected ways. If you must subclass NSRegularExpression, you may want to use a compiler with blocks support.
|
||||
# warning Your compiler would support blocks if you added -fblocks to your OBJCFLAGS
|
||||
# endif
|
||||
#if HAVE_UREGEX_OPENUTEXT
|
||||
#define FAKE_BLOCK_HACK(failRet, code) \
|
||||
UErrorCode s = 0;\
|
||||
|
|
Loading…
Reference in a new issue