Skip to content

Commit

Permalink
Avoid (some cases of) compiler warning; mixing declarations and code …
Browse files Browse the repository at this point in the history
…is incompatible with standards before C99
  • Loading branch information
rfm committed Jul 3, 2024
1 parent f7acef2 commit 0cf5955
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Source/GSDispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@
* Convenience macro to create concurrent dispatch queues for the various
* -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_group_t queue ## Group = NULL;\
if (opts & NSEnumerationConcurrent)\
{\
queue = GS_DISPATCH_GET_DEFAULT_CONCURRENT_QUEUE();\
queue ## Group = GS_DISPATCH_GROUP_CREATE();\
}
{\
queue = GS_DISPATCH_GET_DEFAULT_CONCURRENT_QUEUE();\
queue ## Group = GS_DISPATCH_GROUP_CREATE();\
}

/**
* Convenience macro to destroy concurrent dispatch queues for the various
Expand All @@ -114,10 +114,11 @@
GS_DISPATCH_GROUP_FINISH(queue ## Group);\
GS_DISPATCH_RELEASE(queue ## Group);\
if (NO == (opts & NSEnumerationConcurrent))\
{\
GS_DISPATCH_RELEASE(queue);\
}\
}
{\
GS_DISPATCH_RELEASE(queue);\
}\
}\
}


#else
Expand Down

0 comments on commit 0cf5955

Please sign in to comment.