math_h.m4 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. # math_h.m4 serial 125
  2. dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN_ONCE([gl_MATH_H],
  7. [
  8. AC_REQUIRE([gl_MATH_H_DEFAULTS])
  9. gl_CHECK_NEXT_HEADERS([math.h])
  10. AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
  11. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
  12. [[/* Solaris 10 has a broken definition of NAN. Other platforms
  13. fail to provide NAN, or provide it only in C99 mode; this
  14. test only needs to fail when NAN is provided but wrong. */
  15. float f = 1.0f;
  16. #ifdef NAN
  17. f = NAN;
  18. #endif
  19. return f == 0;]])],
  20. [gl_cv_header_math_nan_works=yes],
  21. [gl_cv_header_math_nan_works=no])])
  22. if test $gl_cv_header_math_nan_works = no; then
  23. REPLACE_NAN=1
  24. fi
  25. AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
  26. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
  27. [[/* Solaris 10 has a broken definition of HUGE_VAL. */
  28. double d = HUGE_VAL;
  29. return d == 0;]])],
  30. [gl_cv_header_math_huge_val_works=yes],
  31. [gl_cv_header_math_huge_val_works=no])])
  32. if test $gl_cv_header_math_huge_val_works = no; then
  33. REPLACE_HUGE_VAL=1
  34. fi
  35. dnl Check for declarations of anything we want to poison if the
  36. dnl corresponding gnulib module is not in use.
  37. gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
  38. [acosf acosl asinf asinl atanf atanl
  39. cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
  40. expf expl exp2 exp2f exp2l expm1 expm1f expm1l
  41. fabsf fabsl floorf floorl fma fmaf fmal
  42. fmod fmodf fmodl frexpf frexpl hypotf hypotl
  43. ilogb ilogbf ilogbl
  44. ldexpf ldexpl
  45. log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
  46. logb logbf logbl
  47. modf modff modfl powf
  48. remainder remainderf remainderl
  49. rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
  50. tanf tanl tanhf trunc truncf truncl])
  51. ])
  52. # gl_MATH_MODULE_INDICATOR([modulename])
  53. # sets the shell variable that indicates the presence of the given module
  54. # to a C preprocessor expression that will evaluate to 1.
  55. # This macro invocation must not occur in macros that are AC_REQUIREd.
  56. AC_DEFUN([gl_MATH_MODULE_INDICATOR],
  57. [
  58. dnl Ensure to expand the default settings once only.
  59. gl_MATH_H_REQUIRE_DEFAULTS
  60. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  61. dnl Define it also as a C macro, for the benefit of the unit tests.
  62. gl_MODULE_INDICATOR_FOR_TESTS([$1])
  63. ])
  64. # Initializes the default values for AC_SUBSTed shell variables.
  65. # This macro must not be AC_REQUIREd. It must only be invoked, and only
  66. # outside of macros or in macros that are not AC_REQUIREd.
  67. AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
  68. [
  69. m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
  70. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF])
  71. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL])
  72. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF])
  73. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL])
  74. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF])
  75. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL])
  76. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F])
  77. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT])
  78. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF])
  79. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL])
  80. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL])
  81. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF])
  82. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL])
  83. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN])
  84. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF])
  85. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL])
  86. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF])
  87. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL])
  88. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF])
  89. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF])
  90. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL])
  91. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2])
  92. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F])
  93. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L])
  94. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1])
  95. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F])
  96. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L])
  97. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF])
  98. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL])
  99. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR])
  100. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF])
  101. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL])
  102. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA])
  103. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF])
  104. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL])
  105. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD])
  106. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF])
  107. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL])
  108. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
  109. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
  110. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
  111. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
  112. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
  113. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
  114. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB])
  115. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF])
  116. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL])
  117. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE])
  118. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
  119. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
  120. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
  121. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
  122. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
  123. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
  124. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
  125. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
  126. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF])
  127. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL])
  128. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10])
  129. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F])
  130. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L])
  131. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P])
  132. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF])
  133. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL])
  134. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2])
  135. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F])
  136. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L])
  137. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
  138. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
  139. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
  140. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
  141. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
  142. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
  143. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF])
  144. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER])
  145. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF])
  146. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL])
  147. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT])
  148. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF])
  149. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL])
  150. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
  151. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
  152. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
  153. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
  154. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
  155. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
  156. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF])
  157. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF])
  158. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL])
  159. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
  160. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
  161. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
  162. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
  163. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
  164. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
  165. dnl Support Microsoft deprecated alias function names by default.
  166. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1])
  167. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1])
  168. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1])
  169. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1])
  170. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1])
  171. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1])
  172. ])
  173. m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS])
  174. AC_REQUIRE([gl_MATH_H_DEFAULTS])
  175. ])
  176. AC_DEFUN([gl_MATH_H_DEFAULTS],
  177. [
  178. dnl Assume proper GNU behavior unless another module says otherwise.
  179. HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
  180. HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
  181. HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
  182. HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
  183. HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
  184. HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
  185. HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
  186. HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
  187. HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
  188. HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
  189. HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
  190. HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
  191. HAVE_COSF=1; AC_SUBST([HAVE_COSF])
  192. HAVE_COSL=1; AC_SUBST([HAVE_COSL])
  193. HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
  194. HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
  195. HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
  196. HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
  197. HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
  198. HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
  199. HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
  200. HAVE_FMA=1; AC_SUBST([HAVE_FMA])
  201. HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
  202. HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
  203. HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
  204. HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
  205. HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
  206. HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
  207. HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
  208. HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
  209. HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
  210. HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
  211. HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
  212. HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
  213. HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
  214. HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
  215. HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
  216. HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
  217. HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
  218. HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
  219. HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
  220. HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
  221. HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
  222. HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
  223. HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
  224. HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
  225. HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
  226. HAVE_POWF=1; AC_SUBST([HAVE_POWF])
  227. HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
  228. HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
  229. HAVE_RINT=1; AC_SUBST([HAVE_RINT])
  230. HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
  231. HAVE_SINF=1; AC_SUBST([HAVE_SINF])
  232. HAVE_SINL=1; AC_SUBST([HAVE_SINL])
  233. HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
  234. HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
  235. HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
  236. HAVE_TANF=1; AC_SUBST([HAVE_TANF])
  237. HAVE_TANL=1; AC_SUBST([HAVE_TANL])
  238. HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
  239. HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
  240. HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
  241. HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
  242. HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
  243. HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
  244. HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
  245. HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
  246. HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
  247. HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
  248. HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
  249. HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
  250. HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
  251. HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
  252. HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
  253. HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
  254. HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
  255. HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
  256. HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
  257. HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
  258. HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
  259. HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
  260. HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
  261. HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
  262. HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
  263. HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
  264. HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
  265. HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
  266. HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
  267. HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
  268. HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
  269. HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
  270. HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
  271. HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
  272. HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
  273. HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
  274. HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
  275. REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
  276. REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
  277. REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
  278. REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
  279. REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
  280. REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
  281. REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
  282. REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
  283. REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
  284. REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
  285. REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
  286. REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
  287. REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
  288. REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
  289. REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
  290. REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
  291. REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
  292. REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
  293. REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
  294. REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
  295. REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
  296. REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
  297. REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
  298. REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
  299. REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
  300. REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
  301. REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
  302. REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
  303. REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
  304. REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
  305. REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
  306. REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
  307. REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
  308. REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
  309. REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
  310. REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
  311. REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
  312. REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
  313. REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
  314. REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
  315. REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
  316. REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
  317. REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
  318. REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
  319. REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
  320. REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
  321. REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
  322. REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
  323. REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
  324. REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
  325. REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
  326. REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
  327. REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
  328. REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
  329. REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
  330. REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
  331. REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
  332. REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
  333. REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
  334. REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
  335. REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
  336. REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
  337. REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
  338. REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
  339. REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
  340. REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
  341. REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
  342. REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
  343. REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
  344. REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
  345. REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
  346. REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
  347. REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
  348. REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
  349. REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
  350. REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
  351. REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
  352. REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
  353. REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
  354. ])
  355. # gl_LONG_DOUBLE_VS_DOUBLE
  356. # determines whether 'long double' and 'double' have the same representation.
  357. # Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
  358. # HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
  359. # The currently known platforms where this is the case are:
  360. # Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
  361. AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
  362. [
  363. AC_CACHE_CHECK([whether long double and double are the same],
  364. [gl_cv_long_double_equals_double],
  365. [AC_COMPILE_IFELSE(
  366. [AC_LANG_PROGRAM([[#include <float.h>]],
  367. [[typedef int check[sizeof (long double) == sizeof (double)
  368. && LDBL_MANT_DIG == DBL_MANT_DIG
  369. && LDBL_MAX_EXP == DBL_MAX_EXP
  370. && LDBL_MIN_EXP == DBL_MIN_EXP
  371. ? 1 : -1];
  372. ]])],
  373. [gl_cv_long_double_equals_double=yes],
  374. [gl_cv_long_double_equals_double=no])
  375. ])
  376. if test $gl_cv_long_double_equals_double = yes; then
  377. AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
  378. [Define to 1 if 'long double' and 'double' have the same representation.])
  379. HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
  380. else
  381. HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
  382. fi
  383. AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
  384. ])