#ifdef / #include CPP issue
The Arduino IDE does its own non-standard preprocessing before the C++ preprocessor/compiler is invoked. One of the main purposes for this is to detect #include directives which refer to libraries so it can link them properly.

My guess would be that part of this procedure ends up moving all #include lines to the start of the file. In the code you've posted, that means I think it's being moved outside the whole #if/#else structure.

In most cases, you can avoid the Arduino IDE trickery by moving things into a separate header or source file. Unfortunately though, doing that means it may not link the libraries properly. As such, the easiest solution may be to switch to a 3rd party IDE which has Arduino support (e.g. Eclipse).