C++ Platform specific includes -


i'm working on multi-platform project. want simple , quick way of managing os-specific includes, preferably without external tools.

i (which i'm 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 

if have same file tree different platfroms specify file name include file in source code , use platform dependent include directory. directory configured environment variable.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -