On 1 March 2018 at 18:54, Marc Glisse wrote:
> On Thu, 1 Mar 2018, Tulio Magno Quites Machado Filho wrote:
>
>> In order to use the __float128 in C++ it's necessary to check if
>> it is supported in libstdc++ (i.e. via _GLIBCXX_USE_FLOAT128) and if the
>> compiler enabled its support too, e.g. -mfloat128 or -mno-float128.
>
>
> Shouldn't we ensure that _GLIBCXX_USE_FLOAT128 is undefined instead?

Yes, a better approach might be to add this to
libstdc++-v3/include/bits/c++config.h:

#define _GLIBCXX_USE_FLOAT128
#if !defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)
#undef _GLIBCXX_USE_FLOAT128
#endif

Then change libstdc++-v3/acinclude.m4 so that instead of defining
_GLIBCXX_USE_FLOAT128 it does:

GLIBCXX_CONDITIONAL(ENABLE_FLOAT128, ...)

and then have libstdc++-v3/include/Makefile modify <bits/c++config.h>
based on that, setting _GLIBCXX_USE_FLOAT128 to 0 or 1

Reply via email to