0001-box-drawings-handle-architecture-with-soft-float.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 9443ac7e2937bb4f26cf44c73bb8150860c5df45 Mon Sep 17 00:00:00 2001
  2. From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
  3. Date: Tue, 4 Feb 2025 09:48:13 +0100
  4. Subject: [PATCH] box-drawings: handle architecture with soft-float
  5. Currently, architecture using soft-floats doesn't support instructions
  6. FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW and FE_UNDERFLOW and so building
  7. on those architectures results with a build error.
  8. As the sqrt math function should set errno to EDOM if an error occurs,
  9. fetestexcept shouldn't be mandatory.
  10. This commit removes the float environment error handling.
  11. Upstream: https://codeberg.org/dnkl/foot/commit/9443ac7e2937bb4f26cf44c73bb8150860c5df45
  12. Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
  13. ---
  14. box-drawing.c | 4 +---
  15. 1 file changed, 1 insertion(+), 3 deletions(-)
  16. diff --git a/box-drawing.c b/box-drawing.c
  17. index 1c613051..421ff54d 100644
  18. --- a/box-drawing.c
  19. +++ b/box-drawing.c
  20. @@ -1462,14 +1462,12 @@ draw_box_drawings_light_arc(struct buf *buf, char32_t wc)
  21. */
  22. for (double i = y_min*16; i <= y_max*16; i++) {
  23. errno = 0;
  24. - feclearexcept(FE_ALL_EXCEPT);
  25. double y = i / 16.;
  26. double x = circle_hemisphere * sqrt(c_r2 - (y - c_y) * (y - c_y)) + c_x;
  27. /* See math_error(7) */
  28. - if (errno != 0 ||
  29. - fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW))
  30. + if (errno != 0)
  31. {
  32. continue;
  33. }
  34. --
  35. 2.48.1