Add i386 architecture detection, add FreeBSD to platform detection (#1135)

defining anything that isn't a specific set of architectures x86 is just wrong.
It should at least be called something non identifying like "native"

Lite-XL already builds for FreeBSD so add it to the platform detection
This commit is contained in:
Jan 2022-10-04 17:13:21 +02:00 committed by GitHub
parent 0277aaf079
commit 630ab0ab92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -85,22 +85,28 @@ void set_macos_bundle_resources(lua_State *L);
#ifndef LITE_ARCH_TUPLE #ifndef LITE_ARCH_TUPLE
#if __x86_64__ || _WIN64 || __MINGW64__ #if __x86_64__ || _WIN64 || __MINGW64__
#define ARCH_PROCESSOR "x86_64" #define ARCH_PROCESSOR "x86_64"
#elif __i386__
#define ARCH_PROCESSOR "x86"
#elif __aarch64__ #elif __aarch64__
#define ARCH_PROCESSOR "aarch64" #define ARCH_PROCESSOR "aarch64"
#elif __arm__ #elif __arm__
#define ARCH_PROCESSOR "arm" #define ARCH_PROCESSOR "arm"
#else
#define ARCH_PROCESSOR "x86"
#endif #endif
#if _WIN32 #if _WIN32
#define ARCH_PLATFORM "windows" #define ARCH_PLATFORM "windows"
#elif __linux__ #elif __linux__
#define ARCH_PLATFORM "linux" #define ARCH_PLATFORM "linux"
#elif __FreeBSD__
#define ARCH_PLATFORM "freebsd"
#elif __APPLE__ #elif __APPLE__
#define ARCH_PLATFORM "darwin" #define ARCH_PLATFORM "darwin"
#else #endif
#if !defined(ARCH_PROCESSOR) || !defined(ARCH_PLATFORM)
#error "Please define -DLITE_ARCH_TUPLE." #error "Please define -DLITE_ARCH_TUPLE."
#endif #endif
#define LITE_ARCH_TUPLE ARCH_PROCESSOR "-" ARCH_PLATFORM #define LITE_ARCH_TUPLE ARCH_PROCESSOR "-" ARCH_PLATFORM
#endif #endif