python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / glibc / patches / glibc-upstream-10.patch
blob1755cbd3adfe5853d90b48458ed3bf7c88d8b7f3
1 From c2921b17a37e887b8a5ca9d84b875b9ba702b79c Mon Sep 17 00:00:00 2001
2 From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
3 Date: Mon, 21 Aug 2017 14:23:27 +0200
4 Subject: [PATCH 10] Do not use __builtin_types_compatible_p in C++ mode
5 (bug 21930)
7 The logic to define isinf for float128 depends on the availability of
8 __builtin_types_compatible_p, which is only available in C mode,
9 however, the conditionals do not check for C or C++ mode. This lead to
10 an error in libstdc++ configure, as reported by bug 21930.
12 This patch adds a conditional for C mode in the definition of isinf for
13 float128. No definition is provided in C++ mode, since libstdc++
14 headers undefine isinf.
16 Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).
18 [BZ #21930]
19 * math/math.h (isinf): Check if in C or C++ mode before using
20 __builtin_types_compatible_p, since this is a C mode feature.
22 (cherry picked from commit 47a67213a9f51c5f8816d240500b10db605d8b77)
23 ---
24 ChangeLog | 6 ++++++
25 NEWS | 1 +
26 math/math.h | 8 ++++++--
27 3 files changed, 13 insertions(+), 2 deletions(-)
29 diff --git a/ChangeLog b/ChangeLog
30 index 6886cd9361..415fa3cc79 100644
31 --- a/ChangeLog
32 +++ b/ChangeLog
33 @@ -1,3 +1,9 @@
34 +2017-08-18 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
36 + [BZ #21930]
37 + * math/math.h (isinf): Check if in C or C++ mode before using
38 + __builtin_types_compatible_p, since this is a C mode feature.
40 2017-08-10 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
42 [BZ #21941]
43 diff --git a/NEWS b/NEWS
44 index d57c4052cf..75b82c899e 100644
45 --- a/NEWS
46 +++ b/NEWS
47 @@ -11,6 +11,7 @@ The following bugs are resolved with this release:
49 [21242] assert: Suppress pedantic warning caused by statement expression
50 [21885] getaddrinfo: Release resolver context on error in gethosts
51 + [21930] Do not use __builtin_types_compatible_p in C++ mode
52 [21932] Unpaired __resolv_context_get in generic get*_r implementation
54 Version 2.26
55 diff --git a/math/math.h b/math/math.h
56 index e21708045a..dea8dbe1ae 100644
57 --- a/math/math.h
58 +++ b/math/math.h
59 @@ -442,8 +442,12 @@ enum
61 /* Return nonzero value if X is positive or negative infinity. */
62 # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
63 - && !defined __SUPPORT_SNAN__
64 - /* __builtin_isinf_sign is broken for float128 only before GCC 7.0. */
65 + && !defined __SUPPORT_SNAN__ && !defined __cplusplus
66 + /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
67 + use the helper function, __isinff128, with older compilers. This is
68 + only provided for C mode, because in C++ mode, GCC has no support
69 + for __builtin_types_compatible_p (and when in C++ mode, this macro is
70 + not used anyway, because libstdc++ headers undefine it). */
71 # define isinf(x) \
72 (__builtin_types_compatible_p (__typeof (x), _Float128) \
73 ? __isinff128 (x) : __builtin_isinf_sign (x))