Files
archived-ballistic/include/bal_platform.h
Ronald Caesar 37cb629909 engine: add platform detection header
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>
2026-01-14 18:58:53 -04:00

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 */