[PATCH] Add nextup and nextdown math functions
Florian Weimer
fweimer@redhat.com
Fri May 20 08:36:00 GMT 2016
On 05/20/2016 08:57 AM, Rajalakshmi Srinivasaraghavan wrote:
> +#ifndef FLOAT
> +# define FLOAT double
> +# define NEXTAFTER nextafter
> +# ifdef USE_AS_NEXTDOWN
> +# define NEXTUP nextdown
> +# else
> +# define NEXTUP nextup
> +# endif
> +#endif
> +
> +#define INTERNAL(X) INTERNAL1(X)
> +#define INTERNAL1(X) __##X
> +
> +FLOAT
> +INTERNAL(NEXTUP) (FLOAT x)
> +{
> +#ifdef USE_AS_NEXTDOWN
Would it make sense to have a file without defaults, and use #if
USE_AS_NEXTDOWN (instead of #ifdef USE_AS_NEXTDOWN)?
In the past, I think we had bugs because of typos or missing overrides
in such constructs, and if the template doesn't have defaults, such bugs
are less likely to happen.
Thanks,
Florian
More information about the Libc-alpha
mailing list