Conditional compilation fails

The way the pre-processing and compiling of sketches works is rather strange and fussy - I believe (but only based on a few issues I've had) that you should place all typedefs in a header file, not in the .ino - you don't say where those code snippets are, but I'd suggest moving them to a mytypes.h or similar header file in your sketch and #include that.