From 352c4bb642947b39e14c4aa58592af8f229e74f2 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 --- lib/yoga/src/main/cpp/yoga/Utils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/yoga/src/main/cpp/yoga/Utils.cpp b/lib/yoga/src/main/cpp/yoga/Utils.cpp index f2af12b2305..e448d99439e 100644 --- a/lib/yoga/src/main/cpp/yoga/Utils.cpp +++ b/lib/yoga/src/main/cpp/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) }