From 66e32b81322c2af16e683e3fecfb2cde2f7fe178 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 16 Nov 2023 22:20:19 +0000 Subject: [PATCH] Better check for LP64 architectures --- nuklear.h | 8 ++++++-- src/nuklear.h | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/nuklear.h b/nuklear.h index baac97f..030eb30 100644 --- a/nuklear.h +++ b/nuklear.h @@ -373,8 +373,10 @@ extern "C" { #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) #define NK_SIZE_TYPE unsigned __int32 #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) + #ifdef __LP64__ #define NK_SIZE_TYPE unsigned long + #elif defined(_WIN64) + #define NK_SIZE_TYPE unsigned long long #else #define NK_SIZE_TYPE unsigned int #endif @@ -388,8 +390,10 @@ extern "C" { #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) #define NK_POINTER_TYPE unsigned __int32 #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) + #ifdef __LP64__ #define NK_POINTER_TYPE unsigned long + #elif defined(_WIN64) + #define NK_POINTER_TYPE unsigned long long #else #define NK_POINTER_TYPE unsigned int #endif diff --git a/src/nuklear.h b/src/nuklear.h index 0b829c4..e275274 100644 --- a/src/nuklear.h +++ b/src/nuklear.h @@ -151,8 +151,10 @@ extern "C" { #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) #define NK_SIZE_TYPE unsigned __int32 #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) + #ifdef __LP64__ #define NK_SIZE_TYPE unsigned long + #elif defined(_WIN64) + #define NK_SIZE_TYPE unsigned long long #else #define NK_SIZE_TYPE unsigned int #endif @@ -166,8 +168,10 @@ extern "C" { #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) #define NK_POINTER_TYPE unsigned __int32 #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) + #ifdef __LP64__ #define NK_POINTER_TYPE unsigned long + #elif defined(_WIN64) + #define NK_POINTER_TYPE unsigned long long #else #define NK_POINTER_TYPE unsigned int #endif