clipper2-exceptions.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h
  2. index b3dddeeaa2..a77cdad5f4 100644
  3. --- a/thirdparty/clipper2/include/clipper2/clipper.core.h
  4. +++ b/thirdparty/clipper2/include/clipper2/clipper.core.h
  5. @@ -21,6 +21,8 @@
  6. #include <numeric>
  7. #include "clipper2/clipper.version.h"
  8. +#define CLIPPER2_THROW(exception) std::abort()
  9. +
  10. namespace Clipper2Lib
  11. {
  12. @@ -78,18 +80,18 @@ namespace Clipper2Lib
  13. switch (error_code)
  14. {
  15. case precision_error_i:
  16. - throw Clipper2Exception(precision_error);
  17. + CLIPPER2_THROW(Clipper2Exception(precision_error));
  18. case scale_error_i:
  19. - throw Clipper2Exception(scale_error);
  20. + CLIPPER2_THROW(Clipper2Exception(scale_error));
  21. case non_pair_error_i:
  22. - throw Clipper2Exception(non_pair_error);
  23. + CLIPPER2_THROW(Clipper2Exception(non_pair_error));
  24. case undefined_error_i:
  25. - throw Clipper2Exception(undefined_error);
  26. + CLIPPER2_THROW(Clipper2Exception(undefined_error));
  27. case range_error_i:
  28. - throw Clipper2Exception(range_error);
  29. + CLIPPER2_THROW(Clipper2Exception(range_error));
  30. }
  31. #else
  32. - ++error_code; // only to stop compiler warning
  33. + if(error_code) {}; // only to stop compiler 'parameter not used' warning
  34. #endif
  35. }