Move out YGValue

Summary:
@public

Creates a single header file for `YGValue`. This is in preparation of a more compact representation of `YGValue` within `YGStyle`.

Also fixes the incorrect definition of NAN.

Reviewed By: SidharthGuglani

Differential Revision: D13439602

fbshipit-source-id: 68eef2c391b6c9810f3c995b86fff7204ebe6511
This commit is contained in:
David Aurelio
2018-12-13 07:09:28 -08:00
committed by Facebook Github Bot
parent 9ddda3c630
commit f23a669ed0
4 changed files with 70 additions and 44 deletions

View File

@@ -17,16 +17,9 @@
#include <stdbool.h>
#endif
// Not defined in MSVC++
#ifndef NAN
static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
#define NAN (*(const float*)__nan)
#endif
#define YGUndefined NAN
#include "YGEnums.h"
#include "YGMacros.h"
#include "YGValue.h"
YG_EXTERN_C_BEGIN
@@ -35,25 +28,6 @@ typedef struct YGSize {
float height;
} YGSize;
typedef struct YGValue {
float value;
YGUnit unit;
} YGValue;
extern const YGValue YGValueUndefined;
extern const YGValue YGValueAuto;
#ifdef __cplusplus
YG_EXTERN_C_END
extern bool operator==(const YGValue& lhs, const YGValue& rhs);
extern bool operator!=(const YGValue& lhs, const YGValue& rhs);
YG_EXTERN_C_BEGIN
#endif
typedef struct YGConfig* YGConfigRef;
typedef struct YGNode* YGNodeRef;