retdec
os.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_UTILS_OS_H
8 #define RETDEC_UTILS_OS_H
9 
10 // Obtain the used operating system. Currently, we only distinguish between
11 // Windows, macOS, and Linux.
12 #if defined(__WIN) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
13  #define OS_WINDOWS
14 #else
15  #include <sys/param.h>
16  #if defined(__APPLE__)
17  #define OS_MACOS
18  #elif defined(BSD)
19  #define OS_BSD
20  #else
21  #define OS_LINUX
22  #endif
23 #endif
24 
25 // It is also useful to know whether the operating system is POSIX compliant.
26 #if defined(OS_MACOS) || defined(OS_LINUX) || defined(OS_BSD)
27  #define OS_POSIX
28 #endif
29 
30 #endif