Use __typeof__ instead of typeof

The latter does not work in ISO C mode: http://gcc.gnu.org/onlinedocs/gcc/Typeof.html