stdlib-ldbl.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* -mlong-double-64 compatibility mode for <stdlib.h> functions.
  17. Copyright (C) 2006-2026 Free Software Foundation, Inc.
  18. This file is part of the GNU C Library.
  19. The GNU C Library is free software; you can redistribute it and/or
  20. modify it under the terms of the GNU Lesser General Public
  21. License as published by the Free Software Foundation; either
  22. version 2.1 of the License, or (at your option) any later version.
  23. The GNU C Library is distributed in the hope that it will be useful,
  24. but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. Lesser General Public License for more details.
  27. You should have received a copy of the GNU Lesser General Public
  28. License along with the GNU C Library; if not, see
  29. <https://www.gnu.org/licenses/>. */
  30. #ifndef _STDLIB_H
  31. # error "Never include <bits/stdlib-ldbl.h> directly; use <stdlib.h> instead."
  32. #endif
  33. #ifdef __USE_ISOC99
  34. # ifdef __LDBL_COMPAT
  35. __LDBL_REDIR1_DECL (strtold, strtod)
  36. # else
  37. __LDBL_REDIR1_DECL (strtold, __strtoieee128)
  38. # endif
  39. #endif
  40. #ifdef __USE_GNU
  41. # ifdef __LDBL_COMPAT
  42. __LDBL_REDIR1_DECL (strtold_l, strtod_l)
  43. # else
  44. __LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l)
  45. # endif
  46. #endif
  47. #if __GLIBC_USE (IEC_60559_BFP_EXT_C23)
  48. # ifdef __LDBL_COMPAT
  49. __LDBL_REDIR1_DECL (strfroml, strfromd)
  50. # else
  51. __LDBL_REDIR1_DECL (strfroml, __strfromieee128)
  52. # endif
  53. #endif
  54. #ifdef __USE_MISC
  55. # if defined __LDBL_COMPAT
  56. __LDBL_REDIR1_DECL (qecvt, ecvt)
  57. __LDBL_REDIR1_DECL (qfcvt, fcvt)
  58. __LDBL_REDIR1_DECL (qgcvt, gcvt)
  59. __LDBL_REDIR1_DECL (qecvt_r, ecvt_r)
  60. __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r)
  61. # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
  62. __LDBL_REDIR1_DECL (qecvt, __qecvtieee128)
  63. __LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128)
  64. __LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128)
  65. __LDBL_REDIR1_DECL (qecvt_r, __qecvtieee128_r)
  66. __LDBL_REDIR1_DECL (qfcvt_r, __qfcvtieee128_r)
  67. # else
  68. # error bits/stdlib-ldbl.h included when no ldbl redirections are required.
  69. # endif
  70. #endif