Problem with #elif

As a simple test, I took the Blink program and stuffed your preprocessor directives in it. I was getting messages that things like OUTPUT, pinmode, Serial, etc. were not in scope when STYLE was non-zero. When I put the #include in, the errors disappeared. This suggests that, for some reason, the declarations that are normally known to the environment were getting lost. I don't know enough about the Gnu preprocessor to know how it works, but if the mapToPort() function is unknown, build your own new header file and fill it with the function declarations from your other source files, as in:

public int mapToPort(int myPort); // Whatever the correct type specifier and arguments are...

and #include the new header file in each source file, and let us know what happens.