mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Avoid (some cases of) compiler warning; mixing declarations and code is incompatible with standards before C99
This commit is contained in:
parent
f7acef2362
commit
0cf5955e00
1 changed files with 10 additions and 9 deletions
|
@ -96,14 +96,14 @@
|
||||||
* Convenience macro to create concurrent dispatch queues for the various
|
* Convenience macro to create concurrent dispatch queues for the various
|
||||||
* -enumerateUsingBlock: methods. Non-concurrent will be run in place.
|
* -enumerateUsingBlock: methods. Non-concurrent will be run in place.
|
||||||
*/
|
*/
|
||||||
#define GS_DISPATCH_CREATE_QUEUE_AND_GROUP_FOR_ENUMERATION(queue, opts)\
|
#define GS_DISPATCH_CREATE_QUEUE_AND_GROUP_FOR_ENUMERATION(queue, opts) {\
|
||||||
dispatch_queue_t queue = NULL;\
|
dispatch_queue_t queue = NULL;\
|
||||||
dispatch_group_t queue ## Group = NULL;\
|
dispatch_group_t queue ## Group = NULL;\
|
||||||
if (opts & NSEnumerationConcurrent)\
|
if (opts & NSEnumerationConcurrent)\
|
||||||
{\
|
{\
|
||||||
queue = GS_DISPATCH_GET_DEFAULT_CONCURRENT_QUEUE();\
|
queue = GS_DISPATCH_GET_DEFAULT_CONCURRENT_QUEUE();\
|
||||||
queue ## Group = GS_DISPATCH_GROUP_CREATE();\
|
queue ## Group = GS_DISPATCH_GROUP_CREATE();\
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience macro to destroy concurrent dispatch queues for the various
|
* Convenience macro to destroy concurrent dispatch queues for the various
|
||||||
|
@ -114,10 +114,11 @@
|
||||||
GS_DISPATCH_GROUP_FINISH(queue ## Group);\
|
GS_DISPATCH_GROUP_FINISH(queue ## Group);\
|
||||||
GS_DISPATCH_RELEASE(queue ## Group);\
|
GS_DISPATCH_RELEASE(queue ## Group);\
|
||||||
if (NO == (opts & NSEnumerationConcurrent))\
|
if (NO == (opts & NSEnumerationConcurrent))\
|
||||||
{\
|
{\
|
||||||
GS_DISPATCH_RELEASE(queue);\
|
GS_DISPATCH_RELEASE(queue);\
|
||||||
}\
|
}\
|
||||||
}
|
}\
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue