Path: blob/master/thirdparty/clipper2/patches/0001-disable-exceptions.patch
9905 views
diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h1index ab71aeb072..110bee4c10 1006442--- a/thirdparty/clipper2/include/clipper2/clipper.core.h3+++ b/thirdparty/clipper2/include/clipper2/clipper.core.h4@@ -19,6 +19,8 @@5#include <numeric>6#include <cmath>78+#define CLIPPER2_THROW(exception) std::abort()9+10namespace Clipper2Lib11{1213@@ -76,21 +78,21 @@ namespace Clipper2Lib14switch (error_code)15{16case precision_error_i:17- throw Clipper2Exception(precision_error);18+ CLIPPER2_THROW(Clipper2Exception(precision_error));19case scale_error_i:20- throw Clipper2Exception(scale_error);21+ CLIPPER2_THROW(Clipper2Exception(scale_error));22case non_pair_error_i:23- throw Clipper2Exception(non_pair_error);24+ CLIPPER2_THROW(Clipper2Exception(non_pair_error));25case undefined_error_i:26- throw Clipper2Exception(undefined_error);27+ CLIPPER2_THROW(Clipper2Exception(undefined_error));28case range_error_i:29- throw Clipper2Exception(range_error);30+ CLIPPER2_THROW(Clipper2Exception(range_error));31// Should never happen, but adding this to stop a compiler warning32default:33- throw Clipper2Exception("Unknown error");34+ CLIPPER2_THROW(Clipper2Exception("Unknown error"));35}36#else37- ++error_code; // only to stop compiler warning38+ if(error_code) {}; // only to stop compiler 'parameter not used' warning39#endif40}41424344