From d4a1d395ece33da2e1e0cd15f57e3ffa52b359d1 Mon Sep 17 00:00:00 2001 From: Ronald Caesar Date: Fri, 23 Jan 2026 17:43:09 -0400 Subject: [PATCH] engine: add arm64 and x86 environment detection Signed-off-by: Ronald Caesar --- include/bal_platform.h | 49 +++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/include/bal_platform.h b/include/bal_platform.h index b66a890..18934ca 100644 --- a/include/bal_platform.h +++ b/include/bal_platform.h @@ -1,24 +1,53 @@ #ifndef BALLISTIC_PLATFORM_H #define BALLISTIC_PLATFORM_H + #if defined(_WIN32) || defined(_WIN64) - #define BAL_PLATFORM_WINDOWS 1 - #define BAL_PLATFORM_POSIX 0 + +#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 + +#define BAL_PLATFORM_WINDOWS 0 +#define BAL_PLATFORM_POSIX 1 + #else - #error "Unknown Platform" + +#error "Unknown Platform" + +#endif + +#if defined(__aarch64__) + +#define BAL_ARCHITECTURE_ARM 1 +#define BAL_ARCHITECTURE_X86 0 + +#elif defined(__x86_64__) + +#define BAL_ARCHITECTURE_ARM 0 +#define BAL_ARCHITECTURE_X86 1 + +#else + +#error "Ballistic requires a 64-bit ARM or x86 environment." + #endif #if defined(_MSC_VER) - #define BAL_COMPILER_MSVC 1 - #define BAL_COMPILER_GCC 0 + +#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 + +#define BAL_COMPILER_MSVC 0 +#define BAL_COMPILER_GCC 1 + #else - #error "Unknown Compiler" + +#error "Unknown Compiler" + #endif #endif /* BALLISTIC_PLATFORM_H */