c99_protos.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /* Declarations of various C99 functions
  2. Copyright (C) 2004-2022 Free Software Foundation, Inc.
  3. This file is part of the GNU Fortran 95 runtime library (libgfortran).
  4. Libgfortran is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. Libgfortran is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. #ifndef C99_PROTOS_H
  20. #define C99_PROTOS_H 1
  21. /* float variants of libm functions */
  22. #ifndef HAVE_ACOSF
  23. #define HAVE_ACOSF 1
  24. extern float acosf(float);
  25. #endif
  26. #if HAVE_ACOSH && !HAVE_ACOSHF
  27. #define HAVE_ACOSHF 1
  28. extern float acoshf(float);
  29. #endif
  30. #ifndef HAVE_ASINF
  31. #define HAVE_ASINF 1
  32. extern float asinf(float);
  33. #endif
  34. #if HAVE_ASINH && !HAVE_ASINHF
  35. #define HAVE_ASINHF 1
  36. extern float asinhf(float);
  37. #endif
  38. #ifndef HAVE_ATAN2F
  39. #define HAVE_ATAN2F 1
  40. extern float atan2f(float, float);
  41. #endif
  42. #ifndef HAVE_ATANF
  43. #define HAVE_ATANF 1
  44. extern float atanf(float);
  45. #endif
  46. #if HAVE_ATANH && !HAVE_ATANHF
  47. #define HAVE_ATANHF 1
  48. extern float atanhf(float);
  49. #endif
  50. #ifndef HAVE_CEILF
  51. #define HAVE_CEILF 1
  52. extern float ceilf(float);
  53. #endif
  54. #ifndef HAVE_COPYSIGNF
  55. #define HAVE_COPYSIGNF 1
  56. extern float copysignf(float, float);
  57. #endif
  58. #if !defined(HAVE_COPYSIGN) && defined(HAVE_INLINE_BUILTIN_COPYSIGN)
  59. #define HAVE_COPYSIGN 1
  60. extern double copysign(double, double);
  61. #endif
  62. #if !defined(HAVE_COPYSIGNL) && defined(HAVE_INLINE_BUILTIN_COPYSIGNL)
  63. #define HAVE_COPYSIGNL 1
  64. extern long double copysignl(long double, long double);
  65. #endif
  66. #ifndef HAVE_COSF
  67. #define HAVE_COSF 1
  68. extern float cosf(float);
  69. #endif
  70. #ifndef HAVE_COSHF
  71. #define HAVE_COSHF 1
  72. extern float coshf(float);
  73. #endif
  74. #ifndef HAVE_EXPF
  75. #define HAVE_EXPF 1
  76. extern float expf(float);
  77. #endif
  78. #ifndef HAVE_FABSF
  79. #define HAVE_FABSF 1
  80. extern float fabsf(float);
  81. #endif
  82. #if !defined(HAVE_FABS) && defined(HAVE_INLINE_BUILTIN_FABS)
  83. #define HAVE_FABS 1
  84. extern double fabs(double);
  85. #endif
  86. #if !defined(HAVE_FABSL) && defined(HAVE_INLINE_BUILTIN_FABSL)
  87. #define HAVE_FABSL 1
  88. extern long double fabsl(long double);
  89. #endif
  90. #ifndef HAVE_FLOORF
  91. #define HAVE_FLOORF 1
  92. extern float floorf(float);
  93. #endif
  94. #ifndef HAVE_FLOORL
  95. #define HAVE_FLOORL 1
  96. extern long double floorl (long double x);
  97. #endif
  98. #ifndef HAVE_FMODF
  99. #define HAVE_FMODF 1
  100. extern float fmodf (float x, float y);
  101. #endif
  102. #ifndef HAVE_FMODL
  103. #define HAVE_FMODL 1
  104. extern long double fmodl (long double x, long double y);
  105. #endif
  106. #ifndef HAVE_FREXPF
  107. #define HAVE_FREXPF 1
  108. extern float frexpf(float, int *);
  109. #endif
  110. #ifndef HAVE_HYPOTF
  111. #define HAVE_HYPOTF 1
  112. extern float hypotf(float, float);
  113. #endif
  114. #ifndef HAVE_LOGF
  115. #define HAVE_LOGF 1
  116. extern float logf(float);
  117. #endif
  118. #ifndef HAVE_LOG10F
  119. #define HAVE_LOG10F 1
  120. extern float log10f(float);
  121. #endif
  122. #ifndef HAVE_SCALBN
  123. #define HAVE_SCALBN 1
  124. extern double scalbn(double, int);
  125. #endif
  126. #ifndef HAVE_SCALBNF
  127. #define HAVE_SCALBNF 1
  128. extern float scalbnf(float, int);
  129. #endif
  130. #ifndef HAVE_SINF
  131. #define HAVE_SINF 1
  132. extern float sinf(float);
  133. #endif
  134. #ifndef HAVE_SINHF
  135. #define HAVE_SINHF 1
  136. extern float sinhf(float);
  137. #endif
  138. #ifndef HAVE_SQRTF
  139. #define HAVE_SQRTF 1
  140. extern float sqrtf(float);
  141. #endif
  142. #ifndef HAVE_TANF
  143. #define HAVE_TANF 1
  144. extern float tanf(float);
  145. #endif
  146. #ifndef HAVE_TANHF
  147. #define HAVE_TANHF 1
  148. extern float tanhf(float);
  149. #endif
  150. #ifndef HAVE_TRUNC
  151. #define HAVE_TRUNC 1
  152. extern double trunc(double);
  153. #endif
  154. #ifndef HAVE_TRUNCF
  155. #define HAVE_TRUNCF 1
  156. extern float truncf(float);
  157. #endif
  158. #ifndef HAVE_NEXTAFTERF
  159. #define HAVE_NEXTAFTERF 1
  160. extern float nextafterf(float, float);
  161. #endif
  162. #ifndef HAVE_POWF
  163. #define HAVE_POWF 1
  164. extern float powf(float, float);
  165. #endif
  166. #ifndef HAVE_ROUND
  167. #define HAVE_ROUND 1
  168. extern double round(double);
  169. #endif
  170. #ifndef HAVE_ROUNDF
  171. #define HAVE_ROUNDF 1
  172. extern float roundf(float);
  173. #endif
  174. #if !defined(HAVE_ROUNDL)
  175. #define HAVE_ROUNDL 1
  176. extern long double roundl(long double);
  177. #endif
  178. #if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
  179. #define HAVE_LROUNDF 1
  180. long int lroundf (float);
  181. #endif
  182. #if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
  183. #define HAVE_LROUND 1
  184. long int lround (double);
  185. #endif
  186. #if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
  187. #define HAVE_LROUNDL 1
  188. long int lroundl (long double);
  189. #endif
  190. #if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
  191. #define HAVE_LLROUNDF 1
  192. long long int llroundf (float);
  193. #endif
  194. #if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
  195. #define HAVE_LLROUND 1
  196. long long int llround (double);
  197. #endif
  198. #if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
  199. #define HAVE_LLROUNDL 1
  200. long long int llroundl (long double);
  201. #endif
  202. /* Wrappers for systems without the various C99 single precision Bessel
  203. functions. */
  204. #if defined(HAVE_J0) && ! defined(HAVE_J0F)
  205. #define HAVE_J0F 1
  206. extern float j0f (float);
  207. #endif
  208. #if defined(HAVE_J1) && !defined(HAVE_J1F)
  209. #define HAVE_J1F 1
  210. extern float j1f (float);
  211. #endif
  212. #if defined(HAVE_JN) && !defined(HAVE_JNF)
  213. #define HAVE_JNF 1
  214. extern float jnf (int, float);
  215. #endif
  216. #if defined(HAVE_Y0) && !defined(HAVE_Y0F)
  217. #define HAVE_Y0F 1
  218. extern float y0f (float);
  219. #endif
  220. #if defined(HAVE_Y1) && !defined(HAVE_Y1F)
  221. #define HAVE_Y1F 1
  222. extern float y1f (float);
  223. #endif
  224. #if defined(HAVE_YN) && !defined(HAVE_YNF)
  225. #define HAVE_YNF 1
  226. extern float ynf (int, float);
  227. #endif
  228. /* Wrappers for systems without the C99 erff() and erfcf() functions. */
  229. #if defined(HAVE_ERF) && !defined(HAVE_ERFF)
  230. #define HAVE_ERFF 1
  231. extern float erff (float);
  232. #endif
  233. #if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
  234. #define HAVE_ERFCF 1
  235. extern float erfcf (float);
  236. #endif
  237. /* log10l is needed on all platforms for decimal I/O */
  238. #ifndef HAVE_LOG10L
  239. #define HAVE_LOG10L 1
  240. extern long double log10l(long double);
  241. #endif
  242. /* complex math functions */
  243. #if !defined(HAVE_CABSF)
  244. #define HAVE_CABSF 1
  245. extern float cabsf (float complex);
  246. #endif
  247. #if !defined(HAVE_CABS)
  248. #define HAVE_CABS 1
  249. extern double cabs (double complex);
  250. #endif
  251. #if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
  252. #define HAVE_CABSL 1
  253. extern long double cabsl (long double complex);
  254. #endif
  255. #if !defined(HAVE_CARGF)
  256. #define HAVE_CARGF 1
  257. extern float cargf (float complex);
  258. #endif
  259. #if !defined(HAVE_CARG)
  260. #define HAVE_CARG 1
  261. extern double carg (double complex);
  262. #endif
  263. #if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
  264. #define HAVE_CARGL 1
  265. extern long double cargl (long double complex);
  266. #endif
  267. #if !defined(HAVE_CEXPF)
  268. #define HAVE_CEXPF 1
  269. extern float complex cexpf (float complex);
  270. #endif
  271. #if !defined(HAVE_CEXP)
  272. #define HAVE_CEXP 1
  273. extern double complex cexp (double complex);
  274. #endif
  275. #if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
  276. #define HAVE_CEXPL 1
  277. extern long double complex cexpl (long double complex);
  278. #endif
  279. #if !defined(HAVE_CLOGF)
  280. #define HAVE_CLOGF 1
  281. extern float complex clogf (float complex);
  282. #endif
  283. #if !defined(HAVE_CLOG)
  284. #define HAVE_CLOG 1
  285. extern double complex clog (double complex);
  286. #endif
  287. #if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
  288. #define HAVE_CLOGL 1
  289. extern long double complex clogl (long double complex);
  290. #endif
  291. #if !defined(HAVE_CLOG10F)
  292. #define HAVE_CLOG10F 1
  293. extern float complex clog10f (float complex);
  294. #endif
  295. #if !defined(HAVE_CLOG10)
  296. #define HAVE_CLOG10 1
  297. extern double complex clog10 (double complex);
  298. #endif
  299. #if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
  300. #define HAVE_CLOG10L 1
  301. extern long double complex clog10l (long double complex);
  302. #endif
  303. #if !defined(HAVE_CPOWF)
  304. #define HAVE_CPOWF 1
  305. extern float complex cpowf (float complex, float complex);
  306. #endif
  307. #if !defined(HAVE_CPOW)
  308. #define HAVE_CPOW 1
  309. extern double complex cpow (double complex, double complex);
  310. #endif
  311. #if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
  312. #define HAVE_CPOWL 1
  313. extern long double complex cpowl (long double complex, long double complex);
  314. #endif
  315. #if !defined(HAVE_CSQRTF)
  316. #define HAVE_CSQRTF 1
  317. extern float complex csqrtf (float complex);
  318. #endif
  319. #if !defined(HAVE_CSQRT)
  320. #define HAVE_CSQRT 1
  321. extern double complex csqrt (double complex);
  322. #endif
  323. #if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
  324. #define HAVE_CSQRTL 1
  325. extern long double complex csqrtl (long double complex);
  326. #endif
  327. #if !defined(HAVE_CSINHF)
  328. #define HAVE_CSINHF 1
  329. extern float complex csinhf (float complex);
  330. #endif
  331. #if !defined(HAVE_CSINH)
  332. #define HAVE_CSINH 1
  333. extern double complex csinh (double complex);
  334. #endif
  335. #if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
  336. #define HAVE_CSINHL 1
  337. extern long double complex csinhl (long double complex);
  338. #endif
  339. #if !defined(HAVE_CCOSHF)
  340. #define HAVE_CCOSHF 1
  341. extern float complex ccoshf (float complex);
  342. #endif
  343. #if !defined(HAVE_CCOSH)
  344. #define HAVE_CCOSH 1
  345. extern double complex ccosh (double complex);
  346. #endif
  347. #if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
  348. #define HAVE_CCOSHL 1
  349. extern long double complex ccoshl (long double complex);
  350. #endif
  351. #if !defined(HAVE_CTANHF)
  352. #define HAVE_CTANHF 1
  353. extern float complex ctanhf (float complex);
  354. #endif
  355. #if !defined(HAVE_CTANH)
  356. #define HAVE_CTANH 1
  357. extern double complex ctanh (double complex);
  358. #endif
  359. #if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
  360. #define HAVE_CTANHL 1
  361. extern long double complex ctanhl (long double complex);
  362. #endif
  363. #if !defined(HAVE_CSINF)
  364. #define HAVE_CSINF 1
  365. extern float complex csinf (float complex);
  366. #endif
  367. #if !defined(HAVE_CSIN)
  368. #define HAVE_CSIN 1
  369. extern double complex csin (double complex);
  370. #endif
  371. #if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
  372. #define HAVE_CSINL 1
  373. extern long double complex csinl (long double complex);
  374. #endif
  375. #if !defined(HAVE_CCOSF)
  376. #define HAVE_CCOSF 1
  377. extern float complex ccosf (float complex);
  378. #endif
  379. #if !defined(HAVE_CCOS)
  380. #define HAVE_CCOS 1
  381. extern double complex ccos (double complex);
  382. #endif
  383. #if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
  384. #define HAVE_CCOSL 1
  385. extern long double complex ccosl (long double complex);
  386. #endif
  387. #if !defined(HAVE_CTANF)
  388. #define HAVE_CTANF 1
  389. extern float complex ctanf (float complex);
  390. #endif
  391. #if !defined(HAVE_CTAN)
  392. #define HAVE_CTAN 1
  393. extern double complex ctan (double complex);
  394. #endif
  395. #if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
  396. #define HAVE_CTANL 1
  397. extern long double complex ctanl (long double complex);
  398. #endif
  399. /* Complex ACOS. */
  400. #if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
  401. #define HAVE_CACOSF 1
  402. extern complex float cacosf (complex float z);
  403. #endif
  404. #if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
  405. #define HAVE_CACOS 1
  406. extern complex double cacos (complex double z);
  407. #endif
  408. #if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
  409. #define HAVE_CACOSL 1
  410. extern complex long double cacosl (complex long double z);
  411. #endif
  412. /* Complex ASIN. */
  413. #if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
  414. #define HAVE_CASINF 1
  415. extern complex float casinf (complex float z);
  416. #endif
  417. #if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
  418. #define HAVE_CASIN 1
  419. extern complex double casin (complex double z);
  420. #endif
  421. #if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
  422. #define HAVE_CASINL 1
  423. extern complex long double casinl (complex long double z);
  424. #endif
  425. /* Complex ATAN. */
  426. #if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
  427. #define HAVE_CATANF 1
  428. extern complex float catanf (complex float z);
  429. #endif
  430. #if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
  431. #define HAVE_CATAN 1
  432. extern complex double catan (complex double z);
  433. #endif
  434. #if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
  435. #define HAVE_CATANL 1
  436. extern complex long double catanl (complex long double z);
  437. #endif
  438. /* Complex ASINH. */
  439. #if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
  440. #define HAVE_CASINHF 1
  441. extern complex float casinhf (complex float z);
  442. #endif
  443. #if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
  444. #define HAVE_CASINH 1
  445. extern complex double casinh (complex double z);
  446. #endif
  447. #if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
  448. #define HAVE_CASINHL 1
  449. extern complex long double casinhl (complex long double z);
  450. #endif
  451. /* Complex ACOSH. */
  452. #if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
  453. #define HAVE_CACOSHF 1
  454. extern complex float cacoshf (complex float z);
  455. #endif
  456. #if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
  457. #define HAVE_CACOSH 1
  458. extern complex double cacosh (complex double z);
  459. #endif
  460. #if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
  461. #define HAVE_CACOSHL 1
  462. extern complex long double cacoshl (complex long double z);
  463. #endif
  464. /* Complex ATANH. */
  465. #if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
  466. #define HAVE_CATANHF 1
  467. extern complex float catanhf (complex float z);
  468. #endif
  469. #if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
  470. #define HAVE_CATANH 1
  471. extern complex double catanh (complex double z);
  472. #endif
  473. #if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
  474. #define HAVE_CATANHL 1
  475. extern complex long double catanhl (complex long double z);
  476. #endif
  477. /* Gamma-related prototypes. */
  478. #if !defined(HAVE_TGAMMA)
  479. #define HAVE_TGAMMA 1
  480. extern double tgamma (double);
  481. #endif
  482. #if !defined(HAVE_LGAMMA)
  483. #define HAVE_LGAMMA 1
  484. extern double lgamma (double);
  485. #endif
  486. #if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
  487. #define HAVE_TGAMMAF 1
  488. extern float tgammaf (float);
  489. #endif
  490. #if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
  491. #define HAVE_LGAMMAF 1
  492. extern float lgammaf (float);
  493. #endif
  494. #ifndef HAVE_FMA
  495. #define HAVE_FMA 1
  496. extern double fma(double, double, double);
  497. #endif
  498. #ifndef HAVE_FMAF
  499. #define HAVE_FMAF 1
  500. extern float fmaf(float, float, float);
  501. #endif
  502. #ifndef HAVE_FMAL
  503. #define HAVE_FMAL 1
  504. extern long double fmal(long double, long double, long double);
  505. #endif
  506. #endif /* C99_PROTOS_H */