Skip to content

Instantly share code, notes, and snippets.

@dsturnbull
Created January 14, 2011 06:18
Show Gist options
  • Save dsturnbull/779258 to your computer and use it in GitHub Desktop.
Save dsturnbull/779258 to your computer and use it in GitHub Desktop.
#define foreach(LIST, FUN) \
{ \
list_t *__i = LIST; \
while (__i != NULL) { \
FUN(__i->node); \
__i = __i->next; \
} \
} while(0)
foreach(world->hexes, ^(hex_t *hex) {
WARN("%p", hex);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment