]> sourceware.org Git - glibc.git/commitdiff
Provide an additional macro expansion for F128 in stdlib/tst-strtod.h
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Wed, 21 Jun 2017 12:20:39 +0000 (09:20 -0300)
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Thu, 22 Jun 2017 16:04:56 +0000 (13:04 -0300)
The macro F128 in stdlib/tst-strtod.h is defined to provide the literal
suffix for _Float128 constants.  It uses the macro __f128 (), which is
defined in bits/floatn.h to provide the correct literal suffix depending on
what is provided by the compiler.

However, F128 was not being expanded and only worked correctly, when
compiling with GCC 7 (or greater), since F128 is the literal suffix itself.
This patch adds an additional macro expansion so that the macro F128
expands to the correct literal suffix on older compilers.

* stdlib/tst-strtod.h (MMFUNC): New macro to provide an addition
macro expansion.
(GEN_TEST_STRTOD_FOREACH): Use MMFUNC for _Float128.

ChangeLog
stdlib/tst-strtod.h

index f282529a9ea6ca778cef6aa26139d450bf875c9c..d01eda76ffb26cedfbbb4f0097fbd4c3a8487ece 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-22  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+       * stdlib/tst-strtod.h (MMFUNC): New macro to provide an addition
+       macro expansion.
+       (GEN_TEST_STRTOD_FOREACH): Use MMFUNC for _Float128.
+
 2017-06-22  Mike FABIAN  <mfabian@redhat.com>
 
        [BZ #21533]
index e23ac3f8ba33c47f33fc6604fa5cf0fd158e6063..bc82ee0595c7769492b07e63c8db152961d01929 100644 (file)
 # define IF_FLOAT128(x)
 #endif
 
+/* Provide an extra parameter expansion for mfunc.  */
+#define MMFUNC(mmfunc, ...) mmfunc (__VA_ARGS__)
+
 /* Splat n variants of the same test for the various strtod functions.  */
 #define GEN_TEST_STRTOD_FOREACH(mfunc, ...)                                  \
   mfunc (  f,       float, strfromf, f, f, ##__VA_ARGS__)                    \
   mfunc (  d,      double, strfromd,  ,  , ##__VA_ARGS__)                    \
   mfunc ( ld, long double, strfroml, L, l, ##__VA_ARGS__)                    \
-  IF_FLOAT128 (mfunc (f128, _Float128, strfromf128, F128, f128, ##__VA_ARGS__))
+  IF_FLOAT128 (MMFUNC                                                        \
+   (mfunc, f128, _Float128, strfromf128, F128, f128, ##__VA_ARGS__))
 /* The arguments to the generated macros are:
    FSUF - Function suffix
    FTYPE - float type
This page took 0.146012 seconds and 5 git commands to generate.