Re-add support for using Yoga without exceptions (#1006)

Summary:
This is a partial rollback of 07c0d539bd.

Pull Request resolved: https://github.com/facebook/yoga/pull/1006

Reviewed By: yungsters

Differential Revision: D40032544

Pulled By: yungsters

fbshipit-source-id: 9ef9b80672eced86a98cfae66c81710bd3ee6f9b
This commit is contained in:
Yannic Bonenberger
2022-10-03 23:35:46 -07:00
committed by Facebook GitHub Bot
parent ec0a829110
commit e1b401ca36
2 changed files with 12 additions and 0 deletions

View File

@@ -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)
}