Preprocessor Directives

A buddy and I are working with SDL on a game. Unfortunately, he is confined to Windows at the moment, while I develop in Linux (SDL is cross platform). The problem is, we use 2 different sets of #includes.

I basically use "#include "SDL/SDL.h" and he uses "#include "SDL.h".

Are there any preprocessor directives or macros that we can use so that one set of includes are used if compiled in windows (xp), and the other set for Linux? (We are both using Eclipse IDE w/ the GCC compiler)

Would appreciate any advice, or tips you can give us!
You can try with something like this:
1
2
3
4
5
6
7
#define ON_WINDOWS

#ifdef ON_WINDOWS
    #include "SLD.h"
#else
    #include "SDL/SDL.h"
#endif 

And if you are compiling on windows leave line 1, if you are compiling on Linux comment that out

Or change compiler settings for the include directories
32bit Windows defines _WIN32
Why can you not just set up the development environment to be the same for both platforms?

Set your include path to include SDL then you can do #include "SDL.h" also.
Thanks everyone! That solved the issue.
Topic archived. No new replies allowed.