Q: Is there anything like an #ifdef for typedefs?
A: Unfortunately, no. (There can't be, because types and typedefs haven't been parsed at preprocessing time.) You may have to keep sets of preprocessor macros (e.g. MY_TYPE_DEFINED) recording whether certain typedefs have been declared.
See also questions 1.13 and 10.13.
ISO Sec. 184.108.40.206, Sec. 6.8.1
H&S Sec. 7.11.1 p. 225