Created
May 8, 2015 19:22
-
-
Save mauricewyn/a809f1268520587e4a24 to your computer and use it in GitHub Desktop.
CFSetForeach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CFSetForeach(type,element,set) \ | |
for (typeof(type) element, \ | |
*_foreach_set = (typeof(type)*)set, \ | |
*_foreach_count = (typeof(type)*)(intptr_t)CFSetGetCount((CFSetRef)_foreach_set), \ | |
*_foreach_cache[(intptr_t)_foreach_count + 1], \ | |
*_foreach_index = (CFSetGetValues((CFSetRef)_foreach_set,(const void**)_foreach_cache), (typeof(type)*)(intptr_t)0); \ | |
element = ((typeof(type)*)_foreach_cache)[(intptr_t)_foreach_index], ((intptr_t)_foreach_index < (intptr_t)_foreach_count); \ | |
_foreach_index = (typeof(type)*)((intptr_t)_foreach_index + 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment