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: D13172444

fbshipit-source-id: 4250dbcf8fe15ec3ecdee3913360a73bab633ce3
This commit is contained in:
David Aurelio
2018-12-06 07:35:08 -08:00
committed by Facebook Github Bot
parent 0962c5220c
commit d19da9e528
4 changed files with 70 additions and 44 deletions

View File

@@ -39,23 +39,6 @@ static int YGDefaultLog(
va_list args);
#endif
const YGValue YGValueZero = {0, YGUnitPoint};
const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined};
const YGValue YGValueAuto = {YGUndefined, YGUnitAuto};
bool operator==(const YGValue& lhs, const YGValue& rhs) {
if ((lhs.unit == YGUnitUndefined && rhs.unit == YGUnitUndefined) ||
(lhs.unit == YGUnitAuto && rhs.unit == YGUnitAuto)) {
return true;
}
return lhs.unit == rhs.unit && lhs.value == rhs.value;
}
bool operator!=(const YGValue& lhs, const YGValue& rhs) {
return !(lhs == rhs);
}
#ifdef ANDROID
#include <android/log.h>
static int YGAndroidLog(