mirror of
https://github.com/pound-emu/ballistic.git
synced 2026-01-31 01:15:21 +01:00
I do not want compiler attributes like __clang__ or __linux__ scattered everywhere to detect the platform Ballistic is running on, so I added preprocessor directives to make things a lot cleaner. Signed-off-by: Ronald Caesar <github43132@proton.me>
25 lines
603 B
C
25 lines
603 B
C
#ifndef BALLISTIC_PLATFORM_H
|
|
#define BALLISTIC_PLATFORM_H
|
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
#define BAL_PLATFORM_WINDOWS 1
|
|
#define BAL_PLATFORM_POSIX 0
|
|
#elif defined(__linux__) || defined(__APPLE__)
|
|
#define BAL_PLATFORM_WINDOWS 0
|
|
#define BAL_PLATFORM_POSIX 1
|
|
#else
|
|
#error "Unknown Platform"
|
|
#endif
|
|
|
|
#if defined(_MSC_VER)
|
|
#define BAL_COMPILER_MSVC 1
|
|
#define BAL_COMPILER_GCC 0
|
|
#elif defined(__GNUC__) || defined(__clang__)
|
|
#define BAL_COMPILER_MSVC 0
|
|
#define BAL_COMPILER_GCC 1
|
|
#else
|
|
#error "Unknown Compiler"
|
|
#endif
|
|
|
|
#endif /* BALLISTIC_PLATFORM_H */
|