math_h.m4 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. # math_h.m4 serial 114
  2. dnl Copyright (C) 2007-2013 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([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. AC_DEFUN([gl_MATH_MODULE_INDICATOR],
  53. [
  54. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  55. AC_REQUIRE([gl_MATH_H_DEFAULTS])
  56. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  57. dnl Define it also as a C macro, for the benefit of the unit tests.
  58. gl_MODULE_INDICATOR_FOR_TESTS([$1])
  59. ])
  60. AC_DEFUN([gl_MATH_H_DEFAULTS],
  61. [
  62. GNULIB_ACOSF=0; AC_SUBST([GNULIB_ACOSF])
  63. GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL])
  64. GNULIB_ASINF=0; AC_SUBST([GNULIB_ASINF])
  65. GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL])
  66. GNULIB_ATANF=0; AC_SUBST([GNULIB_ATANF])
  67. GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL])
  68. GNULIB_ATAN2F=0; AC_SUBST([GNULIB_ATAN2F])
  69. GNULIB_CBRT=0; AC_SUBST([GNULIB_CBRT])
  70. GNULIB_CBRTF=0; AC_SUBST([GNULIB_CBRTF])
  71. GNULIB_CBRTL=0; AC_SUBST([GNULIB_CBRTL])
  72. GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL])
  73. GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
  74. GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
  75. GNULIB_COPYSIGN=0; AC_SUBST([GNULIB_COPYSIGN])
  76. GNULIB_COPYSIGNF=0; AC_SUBST([GNULIB_COPYSIGNF])
  77. GNULIB_COPYSIGNL=0; AC_SUBST([GNULIB_COPYSIGNL])
  78. GNULIB_COSF=0; AC_SUBST([GNULIB_COSF])
  79. GNULIB_COSL=0; AC_SUBST([GNULIB_COSL])
  80. GNULIB_COSHF=0; AC_SUBST([GNULIB_COSHF])
  81. GNULIB_EXPF=0; AC_SUBST([GNULIB_EXPF])
  82. GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL])
  83. GNULIB_EXP2=0; AC_SUBST([GNULIB_EXP2])
  84. GNULIB_EXP2F=0; AC_SUBST([GNULIB_EXP2F])
  85. GNULIB_EXP2L=0; AC_SUBST([GNULIB_EXP2L])
  86. GNULIB_EXPM1=0; AC_SUBST([GNULIB_EXPM1])
  87. GNULIB_EXPM1F=0; AC_SUBST([GNULIB_EXPM1F])
  88. GNULIB_EXPM1L=0; AC_SUBST([GNULIB_EXPM1L])
  89. GNULIB_FABSF=0; AC_SUBST([GNULIB_FABSF])
  90. GNULIB_FABSL=0; AC_SUBST([GNULIB_FABSL])
  91. GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR])
  92. GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF])
  93. GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL])
  94. GNULIB_FMA=0; AC_SUBST([GNULIB_FMA])
  95. GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF])
  96. GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL])
  97. GNULIB_FMOD=0; AC_SUBST([GNULIB_FMOD])
  98. GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF])
  99. GNULIB_FMODL=0; AC_SUBST([GNULIB_FMODL])
  100. GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF])
  101. GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
  102. GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
  103. GNULIB_HYPOT=0; AC_SUBST([GNULIB_HYPOT])
  104. GNULIB_HYPOTF=0; AC_SUBST([GNULIB_HYPOTF])
  105. GNULIB_HYPOTL=0; AC_SUBST([GNULIB_HYPOTL])
  106. GNULIB_ILOGB=0; AC_SUBST([GNULIB_ILOGB])
  107. GNULIB_ILOGBF=0; AC_SUBST([GNULIB_ILOGBF])
  108. GNULIB_ILOGBL=0; AC_SUBST([GNULIB_ILOGBL])
  109. GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
  110. GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF])
  111. GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN])
  112. GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF])
  113. GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
  114. GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
  115. GNULIB_LDEXPF=0; AC_SUBST([GNULIB_LDEXPF])
  116. GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
  117. GNULIB_LOG=0; AC_SUBST([GNULIB_LOG])
  118. GNULIB_LOGF=0; AC_SUBST([GNULIB_LOGF])
  119. GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL])
  120. GNULIB_LOG10=0; AC_SUBST([GNULIB_LOG10])
  121. GNULIB_LOG10F=0; AC_SUBST([GNULIB_LOG10F])
  122. GNULIB_LOG10L=0; AC_SUBST([GNULIB_LOG10L])
  123. GNULIB_LOG1P=0; AC_SUBST([GNULIB_LOG1P])
  124. GNULIB_LOG1PF=0; AC_SUBST([GNULIB_LOG1PF])
  125. GNULIB_LOG1PL=0; AC_SUBST([GNULIB_LOG1PL])
  126. GNULIB_LOG2=0; AC_SUBST([GNULIB_LOG2])
  127. GNULIB_LOG2F=0; AC_SUBST([GNULIB_LOG2F])
  128. GNULIB_LOG2L=0; AC_SUBST([GNULIB_LOG2L])
  129. GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB])
  130. GNULIB_LOGBF=0; AC_SUBST([GNULIB_LOGBF])
  131. GNULIB_LOGBL=0; AC_SUBST([GNULIB_LOGBL])
  132. GNULIB_MODF=0; AC_SUBST([GNULIB_MODF])
  133. GNULIB_MODFF=0; AC_SUBST([GNULIB_MODFF])
  134. GNULIB_MODFL=0; AC_SUBST([GNULIB_MODFL])
  135. GNULIB_POWF=0; AC_SUBST([GNULIB_POWF])
  136. GNULIB_REMAINDER=0; AC_SUBST([GNULIB_REMAINDER])
  137. GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF])
  138. GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL])
  139. GNULIB_RINT=0; AC_SUBST([GNULIB_RINT])
  140. GNULIB_RINTF=0; AC_SUBST([GNULIB_RINTF])
  141. GNULIB_RINTL=0; AC_SUBST([GNULIB_RINTL])
  142. GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND])
  143. GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF])
  144. GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL])
  145. GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT])
  146. GNULIB_SINF=0; AC_SUBST([GNULIB_SINF])
  147. GNULIB_SINL=0; AC_SUBST([GNULIB_SINL])
  148. GNULIB_SINHF=0; AC_SUBST([GNULIB_SINHF])
  149. GNULIB_SQRTF=0; AC_SUBST([GNULIB_SQRTF])
  150. GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL])
  151. GNULIB_TANF=0; AC_SUBST([GNULIB_TANF])
  152. GNULIB_TANL=0; AC_SUBST([GNULIB_TANL])
  153. GNULIB_TANHF=0; AC_SUBST([GNULIB_TANHF])
  154. GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
  155. GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
  156. GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
  157. dnl Assume proper GNU behavior unless another module says otherwise.
  158. HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
  159. HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
  160. HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
  161. HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
  162. HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
  163. HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
  164. HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
  165. HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
  166. HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
  167. HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
  168. HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
  169. HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
  170. HAVE_COSF=1; AC_SUBST([HAVE_COSF])
  171. HAVE_COSL=1; AC_SUBST([HAVE_COSL])
  172. HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
  173. HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
  174. HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
  175. HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
  176. HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
  177. HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
  178. HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
  179. HAVE_FMA=1; AC_SUBST([HAVE_FMA])
  180. HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
  181. HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
  182. HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
  183. HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
  184. HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
  185. HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
  186. HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
  187. HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
  188. HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
  189. HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
  190. HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
  191. HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
  192. HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
  193. HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
  194. HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
  195. HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
  196. HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
  197. HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
  198. HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
  199. HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
  200. HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
  201. HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
  202. HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
  203. HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
  204. HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
  205. HAVE_POWF=1; AC_SUBST([HAVE_POWF])
  206. HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
  207. HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
  208. HAVE_RINT=1; AC_SUBST([HAVE_RINT])
  209. HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
  210. HAVE_SINF=1; AC_SUBST([HAVE_SINF])
  211. HAVE_SINL=1; AC_SUBST([HAVE_SINL])
  212. HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
  213. HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
  214. HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
  215. HAVE_TANF=1; AC_SUBST([HAVE_TANF])
  216. HAVE_TANL=1; AC_SUBST([HAVE_TANL])
  217. HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
  218. HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
  219. HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
  220. HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
  221. HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
  222. HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
  223. HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
  224. HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
  225. HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
  226. HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
  227. HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
  228. HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
  229. HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
  230. HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
  231. HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
  232. HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
  233. HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
  234. HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
  235. HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
  236. HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
  237. HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
  238. HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
  239. HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
  240. HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
  241. HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
  242. HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
  243. HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
  244. HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
  245. HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
  246. HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
  247. HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
  248. HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
  249. HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
  250. HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
  251. HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
  252. HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
  253. HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
  254. REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
  255. REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
  256. REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
  257. REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
  258. REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
  259. REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
  260. REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
  261. REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
  262. REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
  263. REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
  264. REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
  265. REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
  266. REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
  267. REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
  268. REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
  269. REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
  270. REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
  271. REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
  272. REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
  273. REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
  274. REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
  275. REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
  276. REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
  277. REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
  278. REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
  279. REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
  280. REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
  281. REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
  282. REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
  283. REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
  284. REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
  285. REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
  286. REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
  287. REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
  288. REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
  289. REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
  290. REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
  291. REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
  292. REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
  293. REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
  294. REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
  295. REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
  296. REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
  297. REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
  298. REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
  299. REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
  300. REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
  301. REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
  302. REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
  303. REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
  304. REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
  305. REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
  306. REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
  307. REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
  308. REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
  309. REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
  310. REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
  311. REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
  312. REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
  313. REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
  314. REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
  315. REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
  316. REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
  317. ])
  318. # gl_LONG_DOUBLE_VS_DOUBLE
  319. # determines whether 'long double' and 'double' have the same representation.
  320. # Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
  321. # HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
  322. # The currently known platforms where this is the case are:
  323. # Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
  324. AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
  325. [
  326. AC_CACHE_CHECK([whether long double and double are the same],
  327. [gl_cv_long_double_equals_double],
  328. [AC_COMPILE_IFELSE(
  329. [AC_LANG_PROGRAM([[#include <float.h>]],
  330. [[typedef int check[sizeof (long double) == sizeof (double)
  331. && LDBL_MANT_DIG == DBL_MANT_DIG
  332. && LDBL_MAX_EXP == DBL_MAX_EXP
  333. && LDBL_MIN_EXP == DBL_MIN_EXP
  334. ? 1 : -1];
  335. ]])],
  336. [gl_cv_long_double_equals_double=yes],
  337. [gl_cv_long_double_equals_double=no])
  338. ])
  339. if test $gl_cv_long_double_equals_double = yes; then
  340. AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
  341. [Define to 1 if 'long double' and 'double' have the same representation.])
  342. HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
  343. else
  344. HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
  345. fi
  346. AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
  347. ])