Avoid error "global register variables are not supported".
fix EXC_BAD_ACCESS error on Mac OS X

Original-By: Christopher Friedt <chrisfriedt@gmail.com>