diff --git a/ReactCommon/yoga/yoga/YGMacros.h b/ReactCommon/yoga/yoga/YGMacros.h index d67242728..39e21b782 100644 --- a/ReactCommon/yoga/yoga/YGMacros.h +++ b/ReactCommon/yoga/yoga/YGMacros.h @@ -41,18 +41,12 @@ } #endif -#ifndef YG_ENUM_BEGIN -#ifndef NS_ENUM -#define YG_ENUM_BEGIN(name) enum name -#else -#define YG_ENUM_BEGIN(name) NS_ENUM(NSInteger, name) -#endif -#endif - -#ifndef YG_ENUM_END -#ifndef NS_ENUM -#define YG_ENUM_END(name) name -#else +#ifdef NS_ENUM +// Cannot use NSInteger as NSInteger has a different size than int (which is the default type of a enum). +// Therefor when linking the Yoga C library into obj-c the header is a missmatch for the Yoga ABI. +#define YG_ENUM_BEGIN(name) NS_ENUM(int, name) #define YG_ENUM_END(name) -#endif +#else +#define YG_ENUM_BEGIN(name) enum name +#define YG_ENUM_END(name) name #endif