Created
November 26, 2014 19:25
-
-
Save kaworu/32a97b5af1cdb1de727c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <Block.h> | |
typedef void (^vblock)(void); | |
vblock | |
f(void) | |
{ | |
__block int x = 42; | |
__block int *y = &x; | |
return Block_copy(^ { | |
printf("%s\n", (y == &x ? "yeah!" : "arg!")); | |
}); | |
} | |
int | |
main(int argc, char **argv) | |
{ | |
vblock b = f(); | |
b(); | |
Block_release(b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment