The current implementation of
#define pthread_cleanup_push(F, A)\ {\ const _pthread_cleanup _pthread_cup = {(F), (A), *pthread_getclean()};\ __sync_synchronize();\ *pthread_getclean() = (_pthread_cleanup *) &_pthread_cup;\ __sync_synchronize()
is missing a closing } and should be changed to the following to compile properly:
#define pthread_cleanup_push(F, A)\ {\ const _pthread_cleanup _pthread_cup = {(F), (A), *pthread_getclean()};\ __sync_synchronize();\ *pthread_getclean() = (_pthread_cleanup *) &_pthread_cup;\ __sync_synchronize();\ }
Actually no since these two macros are a pair, the missing } is in pthread_cleanup_pop.