Using ENUM_BITFIELDS_NOT_SUPPORTED for enum bitfields
Reviewed By: davidaurelio Differential Revision: D13556160 fbshipit-source-id: e6d373a4e1dd702509b5d63606c08fae9cdb5498
This commit is contained in:
committed by
Facebook Github Bot
parent
4b97375524
commit
efac22a508
@@ -13,6 +13,12 @@
|
|||||||
#include "Yoga-internal.h"
|
#include "Yoga-internal.h"
|
||||||
#include "Yoga.h"
|
#include "Yoga.h"
|
||||||
|
|
||||||
|
#if !defined(ENUM_BITFIELDS_NOT_SUPPORTED)
|
||||||
|
#define BITFIELD_ENUM_SIZED(num) : num
|
||||||
|
#else
|
||||||
|
#define BITFIELD_ENUM_SIZED(num)
|
||||||
|
#endif
|
||||||
|
|
||||||
constexpr YGValue kYGValueUndefined = {0, YGUnitUndefined};
|
constexpr YGValue kYGValueUndefined = {0, YGUnitUndefined};
|
||||||
|
|
||||||
constexpr YGValue kYGValueAuto = {0, YGUnitAuto};
|
constexpr YGValue kYGValueAuto = {0, YGUnitAuto};
|
||||||
@@ -25,16 +31,18 @@ public:
|
|||||||
using Dimensions = facebook::yoga::detail::Values<2>;
|
using Dimensions = facebook::yoga::detail::Values<2>;
|
||||||
using Edges = facebook::yoga::detail::Values<YGEdgeCount>;
|
using Edges = facebook::yoga::detail::Values<YGEdgeCount>;
|
||||||
|
|
||||||
YGDirection direction : 2;
|
/* Some platforms don't support enum bitfields,
|
||||||
YGFlexDirection flexDirection : 2;
|
so please use BITFIELD_ENUM_SIZED(BITS_COUNT) */
|
||||||
YGJustify justifyContent : 3;
|
YGDirection direction BITFIELD_ENUM_SIZED(2);
|
||||||
YGAlign alignContent : 3;
|
YGFlexDirection flexDirection BITFIELD_ENUM_SIZED(2);
|
||||||
YGAlign alignItems : 3;
|
YGJustify justifyContent BITFIELD_ENUM_SIZED(3);
|
||||||
YGAlign alignSelf : 3;
|
YGAlign alignContent BITFIELD_ENUM_SIZED(3);
|
||||||
YGPositionType positionType : 1;
|
YGAlign alignItems BITFIELD_ENUM_SIZED(3);
|
||||||
YGWrap flexWrap : 2;
|
YGAlign alignSelf BITFIELD_ENUM_SIZED(3);
|
||||||
YGOverflow overflow : 2;
|
YGPositionType positionType BITFIELD_ENUM_SIZED(1);
|
||||||
YGDisplay display : 1;
|
YGWrap flexWrap BITFIELD_ENUM_SIZED(2);
|
||||||
|
YGOverflow overflow BITFIELD_ENUM_SIZED(2);
|
||||||
|
YGDisplay display BITFIELD_ENUM_SIZED(1);
|
||||||
YGFloatOptional flex = {};
|
YGFloatOptional flex = {};
|
||||||
YGFloatOptional flexGrow = {};
|
YGFloatOptional flexGrow = {};
|
||||||
YGFloatOptional flexShrink = {};
|
YGFloatOptional flexShrink = {};
|
||||||
|
Reference in New Issue
Block a user