evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / gn / gnulib / gnulib-longdouble-redirect.patch
blobf684292dc8bd32774e0d3a4832431c14fe187cab
2 Below is the subset of gnulib commit
3 776af40e09b476a41073131a90022572f448c189 which deals with long double
4 redirects. The rest of that commit has been removed.
6 diff --git a/lib/cdefs.h b/lib/cdefs.h
7 index fd72b7b..4383e70 100644
8 --- a/lib/cdefs.h
9 +++ b/lib/cdefs.h
10 @@ -483,7 +493,37 @@
11 # include <bits/long-double.h>
12 #endif
14 -#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
15 +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
16 +# ifdef __REDIRECT
18 +/* Alias name defined automatically. */
19 +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
20 +# define __LDBL_REDIR_DECL(name) \
21 + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
23 +/* Alias name defined automatically, with leading underscores. */
24 +# define __LDBL_REDIR2_DECL(name) \
25 + extern __typeof (__##name) __##name \
26 + __asm (__ASMNAME ("__" #name "ieee128"));
28 +/* Alias name defined manually. */
29 +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
30 +# define __LDBL_REDIR1_DECL(name, alias) \
31 + extern __typeof (name) name __asm (__ASMNAME (#alias));
33 +# define __LDBL_REDIR1_NTH(name, proto, alias) \
34 + __REDIRECT_NTH (name, proto, alias)
35 +# define __REDIRECT_NTH_LDBL(name, proto, alias) \
36 + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
38 +/* Unused. */
39 +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
40 +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
42 +# else
43 +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
44 +# endif
45 +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
46 # define __LDBL_COMPAT 1
47 # ifdef __REDIRECT
48 # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
49 @@ -492,6 +532,8 @@
50 # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
51 # define __LDBL_REDIR_NTH(name, proto) \
52 __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
53 +# define __LDBL_REDIR2_DECL(name) \
54 + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
55 # define __LDBL_REDIR1_DECL(name, alias) \
56 extern __typeof (name) name __asm (__ASMNAME (#alias));
57 # define __LDBL_REDIR_DECL(name) \
58 @@ -502,11 +544,13 @@
59 __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
60 # endif
61 #endif
62 -#if !defined __LDBL_COMPAT || !defined __REDIRECT
63 +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
64 + || !defined __REDIRECT
65 # define __LDBL_REDIR1(name, proto, alias) name proto
66 # define __LDBL_REDIR(name, proto) name proto
67 # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
68 # define __LDBL_REDIR_NTH(name, proto) name proto __THROW
69 +# define __LDBL_REDIR2_DECL(name)
70 # define __LDBL_REDIR_DECL(name)
71 # ifdef __REDIRECT
72 # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)