From 23819dd8b53b34dbff2e8c6e7c623a2ea90392be Mon Sep 17 00:00:00 2001 From: Ben Holcomb Date: Sat, 7 Jan 2017 10:23:02 -0800 Subject: [PATCH] Revert D4386906: [YogaKit] Improved the objective-c and swift api Differential Revision: D4386906 fbshipit-source-id: adac0d8e71ce9f3442f3bfd14b5157f88367c998 --- ReactCommon/yoga/yoga/YGEnums.h | 56 ++++++++++++++++---------------- ReactCommon/yoga/yoga/YGMacros.h | 16 --------- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/ReactCommon/yoga/yoga/YGEnums.h b/ReactCommon/yoga/yoga/YGEnums.h index 0a10bbc2f..24606bcd0 100644 --- a/ReactCommon/yoga/yoga/YGEnums.h +++ b/ReactCommon/yoga/yoga/YGEnums.h @@ -14,29 +14,29 @@ YG_EXTERN_C_BEGIN #define YGFlexDirectionCount 4 -typedef YG_ENUM_BEGIN(YGFlexDirection) { +typedef enum YGFlexDirection { YGFlexDirectionColumn, YGFlexDirectionColumnReverse, YGFlexDirectionRow, YGFlexDirectionRowReverse, -} YG_ENUM_END(YGFlexDirection); +} YGFlexDirection; #define YGMeasureModeCount 3 -typedef YG_ENUM_BEGIN(YGMeasureMode) { +typedef enum YGMeasureMode { YGMeasureModeUndefined, YGMeasureModeExactly, YGMeasureModeAtMost, -} YG_ENUM_END(YGMeasureMode); +} YGMeasureMode; #define YGPrintOptionsCount 3 -typedef YG_ENUM_BEGIN(YGPrintOptions) { +typedef enum YGPrintOptions { YGPrintOptionsLayout = 1, YGPrintOptionsStyle = 2, YGPrintOptionsChildren = 4, -} YG_ENUM_END(YGPrintOptions); +} YGPrintOptions; #define YGEdgeCount 9 -typedef YG_ENUM_BEGIN(YGEdge) { +typedef enum YGEdge { YGEdgeLeft, YGEdgeTop, YGEdgeRight, @@ -46,79 +46,79 @@ typedef YG_ENUM_BEGIN(YGEdge) { YGEdgeHorizontal, YGEdgeVertical, YGEdgeAll, -} YG_ENUM_END(YGEdge); +} YGEdge; #define YGPositionTypeCount 2 -typedef YG_ENUM_BEGIN(YGPositionType) { +typedef enum YGPositionType { YGPositionTypeRelative, YGPositionTypeAbsolute, -} YG_ENUM_END(YGPositionType); +} YGPositionType; #define YGDimensionCount 2 -typedef YG_ENUM_BEGIN(YGDimension) { +typedef enum YGDimension { YGDimensionWidth, YGDimensionHeight, -} YG_ENUM_END(YGDimension); +} YGDimension; #define YGJustifyCount 5 -typedef YG_ENUM_BEGIN(YGJustify) { +typedef enum YGJustify { YGJustifyFlexStart, YGJustifyCenter, YGJustifyFlexEnd, YGJustifySpaceBetween, YGJustifySpaceAround, -} YG_ENUM_END(YGJustify); +} YGJustify; #define YGDirectionCount 3 -typedef YG_ENUM_BEGIN(YGDirection) { +typedef enum YGDirection { YGDirectionInherit, YGDirectionLTR, YGDirectionRTL, -} YG_ENUM_END(YGDirection); +} YGDirection; #define YGLogLevelCount 5 -typedef YG_ENUM_BEGIN(YGLogLevel) { +typedef enum YGLogLevel { YGLogLevelError, YGLogLevelWarn, YGLogLevelInfo, YGLogLevelDebug, YGLogLevelVerbose, -} YG_ENUM_END(YGLogLevel); +} YGLogLevel; #define YGWrapCount 2 -typedef YG_ENUM_BEGIN(YGWrap) { +typedef enum YGWrap { YGWrapNoWrap, YGWrapWrap, -} YG_ENUM_END(YGWrap); +} YGWrap; #define YGOverflowCount 3 -typedef YG_ENUM_BEGIN(YGOverflow) { +typedef enum YGOverflow { YGOverflowVisible, YGOverflowHidden, YGOverflowScroll, -} YG_ENUM_END(YGOverflow); +} YGOverflow; #define YGExperimentalFeatureCount 2 -typedef YG_ENUM_BEGIN(YGExperimentalFeature) { +typedef enum YGExperimentalFeature { YGExperimentalFeatureRounding, YGExperimentalFeatureWebFlexBasis, -} YG_ENUM_END(YGExperimentalFeature); +} YGExperimentalFeature; #define YGAlignCount 6 -typedef YG_ENUM_BEGIN(YGAlign) { +typedef enum YGAlign { YGAlignAuto, YGAlignFlexStart, YGAlignCenter, YGAlignFlexEnd, YGAlignStretch, YGAlignBaseline, -} YG_ENUM_END(YGAlign); +} YGAlign; #define YGUnitCount 3 -typedef YG_ENUM_BEGIN(YGUnit) { +typedef enum YGUnit { YGUnitUndefined, YGUnitPixel, YGUnitPercent, -} YG_ENUM_END(YGUnit); +} YGUnit; YG_EXTERN_C_END diff --git a/ReactCommon/yoga/yoga/YGMacros.h b/ReactCommon/yoga/yoga/YGMacros.h index d67242728..def8371ac 100644 --- a/ReactCommon/yoga/yoga/YGMacros.h +++ b/ReactCommon/yoga/yoga/YGMacros.h @@ -40,19 +40,3 @@ YG_ABORT(); \ } #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 -#define YG_ENUM_END(name) -#endif -#endif