Skip to content

Commit

Permalink
Always provide declarations of long double math functions when !_LIBC
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab authored and smx-smx committed Feb 26, 2023
1 parent ab201f2 commit 1a39fb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions math/complex.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 1999, 2000, 2006 Free Software Foundation, Inc.
/* Copyright (C) 1997, 1998, 1999, 2000, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -85,7 +85,8 @@ __BEGIN_DECLS
/* And the long double versions. It is non-critical to define them
here unconditionally since `long double' is required in ISO C99. */
#if (__STDC__ - 0 || __GNUC__ - 0) \
&& (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
&& (!(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \
|| defined __LDBL_COMPAT)
# ifdef __LDBL_COMPAT
# undef __MATHDECL_1
# define __MATHDECL_1(type, function, args) \
Expand Down
9 changes: 5 additions & 4 deletions math/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ __BEGIN_DECLS
# undef __MATH_PRECNAME

# if (__STDC__ - 0 || __GNUC__ - 0) \
&& (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
&& (!(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \
|| defined __LDBL_COMPAT)
# ifdef __LDBL_COMPAT

# ifdef __USE_ISOC99
Expand All @@ -116,9 +117,6 @@ extern long double __REDIRECT_NTH (nexttowardl,
# endif
# endif

/* Include the file of declarations again, this time using `long double'
instead of `double' and appending l to each function name. */

# undef __MATHDECL_1
# define __MATHDECL_2(type, function,suffix, args, alias) \
extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
Expand All @@ -127,6 +125,9 @@ extern long double __REDIRECT_NTH (nexttowardl,
__MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
# endif

/* Include the file of declarations again, this time using `long double'
instead of `double' and appending l to each function name. */

# ifndef _Mlong_double_
# define _Mlong_double_ long double
# endif
Expand Down

0 comments on commit 1a39fb5

Please sign in to comment.