I want to import windows.h and run a few things, but only if the program is running under windows, not Linux or mac. How to define if the program is running under the definite system and run definite code?
Asked
Active
Viewed 60 times
0
-
2Possible duplicate of [How do I check OS with a preprocessor directive?](https://stackoverflow.com/questions/142508/how-do-i-check-os-with-a-preprocessor-directive) – awiebe Oct 25 '18 at 07:19
-
I assume you want to know if you're *compiling* for Windows? (Since it's possible to compile for Windows and run the program under Linux using Wine, and in that case you probably still want to use `windows.h`.) – HolyBlackCat Oct 25 '18 at 07:20
-
You can use #ifdef to define which header should be compiled under certain OS – Denis Sablukov Oct 25 '18 at 07:21
-
`#ifdef WIN_32` – Алексей Неудачин Oct 25 '18 at 09:51