This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Provide a C++ version of issignaling that does not use __MATH_TG
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Fri, 18 Aug 2017 14:32:12 +0200
- Subject: Re: [PATCH v2] Provide a C++ version of issignaling that does not use __MATH_TG
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7F952FEBA
- References: <20170818122438.18055-1-gftg@linux.vnet.ibm.com>
On 08/18/2017 02:24 PM, Gabriel F. T. Gomes wrote:
> +# ifndef __cplusplus
> +# define issignaling(x) __MATH_TG ((x), __issignaling, (x))
> +# else
> + /* In C++ mode, __MATH_TG cannot be used, because it relies on
> + __builtin_types_compatible_p, which is a C-only builtin. On the
> + other hand, overloading provides the means to distinguish between
> + the floating-point types. The overloading resolution will match
> + the correct parameter (regardless of type qualifiers (i.e.: const
> + and volatile). */
> +extern "C++" {
> +int issignaling (float __val) { return __issignalingf (__val); }
> +int issignaling (double __val) { return __issignaling (__val); }
> +int issignaling (long double __val) { return __issignalingl (__val); }
> +#if __HAVE_DISTINCT_FLOAT128
> +int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
> +#endif
> +} /* extern C++ */
> +# endif
All function definitions need an inline keyword.
The inner #ifdef needs to be indented. There's a spurious space after
_Float128.
Thanks,
Florian