Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (26 sloc) 544 Bytes
Test your installation by running:
clang -o sample -fblocks sample.c -lBlocksRuntime && ./sample
The above line should result in:
Hello world 2
If you have everything correctly installed.
#ifndef __BLOCKS__
#error must be compiled with -fblocks option enabled
#include <stdio.h>
#include <Block.h>
int main()
__block int i;
i = 0;
void (^block)() = ^{
printf("Hello world %d\n", i);
void (^block2)() = Block_copy(block);
return 0;