From 5f903187ac0c979943db2a8c44be67f416672aa6 Mon Sep 17 00:00:00 2001 From: bloombit Date: Sat, 16 May 2026 15:58:07 -0400 Subject: [PATCH] Make binaryninjacore.h parseable with default xcode clang --- binaryninjacore.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/binaryninjacore.h b/binaryninjacore.h index 61b7798c9..70ced2a04 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -100,8 +100,10 @@ // BN_ENUM macro for defining enums with explicit size in a C-compatible way // In C++, use an explicitly sized enum directly. // In C, add a typedef to the underlying type and use an unnamed enum to define the values. -#if defined(__cplusplus) || __has_extension(c_fixed_enum) +#if defined(__cplusplus) #define BN_ENUM(type, name) enum __BN_ENUM_ATTRIBUTES name : type +#elif __has_extension(c_fixed_enum) + #define BN_ENUM(type, name) typedef type name; enum __BN_ENUM_ATTRIBUTES name : type #else #define BN_ENUM(type, name) typedef type name; enum __BN_ENUM_ATTRIBUTES #endif @@ -109,8 +111,10 @@ // BN_OPTIONS macro for defining flag enums with explicit size in a C-compatible way // In C++, use an explicitly sized enum directly. // In C, add a typedef to the underlying type and use an unnamed enum to define the values. -#if defined(__cplusplus) || __has_extension(c_fixed_enum) +#if defined(__cplusplus) #define BN_OPTIONS(type, name) enum __BN_OPTIONS_ATTRIBUTES name : type +#elif __has_extension(c_fixed_enum) + #define BN_OPTIONS(type, name) typedef type name; enum __BN_OPTIONS_ATTRIBUTES name : type #else #define BN_OPTIONS(type, name) typedef type name; enum __BN_OPTIONS_ATTRIBUTES #endif