clipper2-exceptions.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h
  2. index c7522cb900..086d1b659c 100644
  3. --- a/thirdparty/clipper2/include/clipper2/clipper.core.h
  4. +++ b/thirdparty/clipper2/include/clipper2/clipper.core.h
  5. @@ -20,6 +20,8 @@
  6. #include <climits>
  7. #include <numeric>
  8. +#define CLIPPER2_THROW(exception) std::abort()
  9. +
  10. namespace Clipper2Lib
  11. {
  12. @@ -65,16 +67,16 @@ 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 range_error_i:
  25. - throw Clipper2Exception(range_error);
  26. + CLIPPER2_THROW(Clipper2Exception(range_error));
  27. }
  28. #else
  29. - ++error_code; // only to stop compiler warning
  30. + if(error_code) {}; // only to stop compiler 'parameter not used' warning
  31. #endif
  32. }