logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-avoid-inline-functions-involving-long-double-in-math.patch (3319B)


  1. From 9b972aaf435f15ce82b9f3dc006877d6cdd04592 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Thu, 30 Sep 2021 22:21:25 -0700
  4. Subject: [PATCH] avoid inline functions involving long double in math.h
  5. ---
  6. include/math.h | 11 ++++++-----
  7. src/math/__isgreaterequall.c | 6 ++++++
  8. src/math/__isgreaterl.c | 6 ++++++
  9. src/math/__islessequall.c | 6 ++++++
  10. src/math/__islessgreaterl.c | 6 ++++++
  11. src/math/__islessl.c | 6 ++++++
  12. 6 files changed, 36 insertions(+), 5 deletions(-)
  13. create mode 100644 src/math/__isgreaterequall.c
  14. create mode 100644 src/math/__isgreaterl.c
  15. create mode 100644 src/math/__islessequall.c
  16. create mode 100644 src/math/__islessgreaterl.c
  17. create mode 100644 src/math/__islessl.c
  18. diff --git a/include/math.h b/include/math.h
  19. index 14f28ec8..0286fba4 100644
  20. --- a/include/math.h
  21. +++ b/include/math.h
  22. @@ -107,19 +107,20 @@ static __inline int __is##rel(type __x, type __y) \
  23. __ISREL_DEF(lessf, <, float_t)
  24. __ISREL_DEF(less, <, double_t)
  25. -__ISREL_DEF(lessl, <, long double)
  26. __ISREL_DEF(lessequalf, <=, float_t)
  27. __ISREL_DEF(lessequal, <=, double_t)
  28. -__ISREL_DEF(lessequall, <=, long double)
  29. __ISREL_DEF(lessgreaterf, !=, float_t)
  30. __ISREL_DEF(lessgreater, !=, double_t)
  31. -__ISREL_DEF(lessgreaterl, !=, long double)
  32. __ISREL_DEF(greaterf, >, float_t)
  33. __ISREL_DEF(greater, >, double_t)
  34. -__ISREL_DEF(greaterl, >, long double)
  35. __ISREL_DEF(greaterequalf, >=, float_t)
  36. __ISREL_DEF(greaterequal, >=, double_t)
  37. -__ISREL_DEF(greaterequall, >=, long double)
  38. +
  39. +int __islessl(long double, long double);
  40. +int __islessequall(long double, long double);
  41. +int __islessgreaterl(long double, long double);
  42. +int __isgreaterl(long double, long double);
  43. +int __isgreaterequall(long double, long double);
  44. #define __tg_pred_2(x, y, p) ( \
  45. sizeof((x)+(y)) == sizeof(float) ? p##f(x, y) : \
  46. diff --git a/src/math/__isgreaterequall.c b/src/math/__isgreaterequall.c
  47. new file mode 100644
  48. index 00000000..2d014213
  49. --- /dev/null
  50. +++ b/src/math/__isgreaterequall.c
  51. @@ -0,0 +1,6 @@
  52. +#include <math.h>
  53. +
  54. +int __isgreaterequall(long double x, long double y)
  55. +{
  56. + return !isunordered(x, y) && x >= y;
  57. +}
  58. diff --git a/src/math/__isgreaterl.c b/src/math/__isgreaterl.c
  59. new file mode 100644
  60. index 00000000..835fe575
  61. --- /dev/null
  62. +++ b/src/math/__isgreaterl.c
  63. @@ -0,0 +1,6 @@
  64. +#include <math.h>
  65. +
  66. +int __isgreaterl(long double x, long double y)
  67. +{
  68. + return !isunordered(x, y) && x > y;
  69. +}
  70. diff --git a/src/math/__islessequall.c b/src/math/__islessequall.c
  71. new file mode 100644
  72. index 00000000..3534ab5b
  73. --- /dev/null
  74. +++ b/src/math/__islessequall.c
  75. @@ -0,0 +1,6 @@
  76. +#include <math.h>
  77. +
  78. +int __islessequall(long double x, long double y)
  79. +{
  80. + return !isunordered(x, y) && x <= y;
  81. +}
  82. diff --git a/src/math/__islessgreaterl.c b/src/math/__islessgreaterl.c
  83. new file mode 100644
  84. index 00000000..e8543384
  85. --- /dev/null
  86. +++ b/src/math/__islessgreaterl.c
  87. @@ -0,0 +1,6 @@
  88. +#include <math.h>
  89. +
  90. +int __islessgreaterl(long double x, long double y)
  91. +{
  92. + return !isunordered(x, y) && x != y;
  93. +}
  94. diff --git a/src/math/__islessl.c b/src/math/__islessl.c
  95. new file mode 100644
  96. index 00000000..27b48d0e
  97. --- /dev/null
  98. +++ b/src/math/__islessl.c
  99. @@ -0,0 +1,6 @@
  100. +#include <math.h>
  101. +
  102. +int __islessl(long double x, long double y)
  103. +{
  104. + return !isunordered(x, y) && x < y;
  105. +}
  106. --
  107. 2.32.0