Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions binaryninjacore.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,21 @@
// 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

// 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
Expand Down