Permalink
Browse files

Use int instead of NSInteger for ABI compatibility

Summary: 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.

Reviewed By: cwdick

Differential Revision: D4392272

fbshipit-source-id: 22b92ac8f3eb7114e81dbd9b0bec9044c3d43da5
  • Loading branch information...
emilsjolander authored and facebook-github-bot committed Jan 9, 2017
1 parent 30e89b4 commit 618a14b228106529eb5c5adb7a9e670c9f3adf8c
Showing with 6 additions and 12 deletions.
  1. +6 −12 ReactCommon/yoga/yoga/YGMacros.h
@@ -41,18 +41,12 @@
}
#endif
#ifndef YG_ENUM_BEGIN
#ifndef NS_ENUM
#define YG_ENUM_BEGIN(name) enum name
#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)
#else
#define YG_ENUM_BEGIN(name) NS_ENUM(NSInteger, name)
#endif
#endif
#ifndef YG_ENUM_END
#ifndef NS_ENUM
#define YG_ENUM_BEGIN(name) enum name
#define YG_ENUM_END(name) name
#else
#define YG_ENUM_END(name)
#endif
#endif

0 comments on commit 618a14b

Please sign in to comment.