Question: I'm working on a multi-platform project. I want a simple and quick way of managing OS-specific includes, preferably without any external tools.

I would like something like this (which I'm well aware won't work)

```
#define PLATFORM_A 1
#define PLATFORM_B 2

#ifndef TARGET_PLATFORM
//ERROR
#endif

#if TARGET_PLATFORM == PLATFORM_A
    #define DIR "a"
#elif TARGET_PLATFORM == PLATFORM_B
    #define DIR "b"

#define PLATFORM_INCLUDE(file) \
    #include "platforms/" DIR "/" file

```

Answer: 
One set up I see fairly frequently is as follows:

```
// platform.h

#if defined PLATFORM_A
    #include "platform_a.h"
#elif defined PLATFORM_B
    #include "platform_b.h"
#else
    // #pragma error or whatever
#endif

```

Then `#include "platform.h"` where necessary.
You can have preprocessor directives defined by the platform itself. In this way you can use:

```
#ifndef MAC // MAC performs #define MAC

#ifndef WINDOWS // Windows performs #define WINDOWS

#ifndef UNIX // Unix performs #define UNIX

// ERROR

#endif

#endif

#endif

```