From 793ebf6812f41ad9b07fe04d43a8509a55ebe45e Mon Sep 17 00:00:00 2001 From: Yannic Bonenberger Date: Mon, 3 Oct 2022 23:35:46 -0700 Subject: [PATCH] Re-add support for using Yoga without exceptions (#1006) Summary: This is a partial rollback of 07c0d539bdb3a248762d0a06fd3f622b278a7ecb. X-link: https://github.com/facebook/yoga/pull/1006 Reviewed By: yungsters Differential Revision: D40032544 Pulled By: yungsters fbshipit-source-id: 9ef9b80672eced86a98cfae66c81710bd3ee6f9b --- ReactCommon/yoga/yoga/Utils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/yoga/yoga/Utils.cpp b/ReactCommon/yoga/yoga/Utils.cpp index f2af12b2305d44..e448d99439e24d 100644 --- a/ReactCommon/yoga/yoga/Utils.cpp +++ b/ReactCommon/yoga/yoga/Utils.cpp @@ -75,5 +75,9 @@ YGFloatOptional YGFloatOptionalMax(YGFloatOptional op1, YGFloatOptional op2) { } void throwLogicalErrorWithMessage(const char* message) { +#if defined(__cpp_exceptions) throw std::logic_error(message); +#else // !defined(__cpp_exceptions) + std::terminate(); +#endif // defined(__cpp_exceptions) }