This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/6] float128: Add conversion from float128 to mpn
On Fri, 26 May 2017, Gabriel F. T. Gomes wrote:
> diff --git a/misc/sys/param.h b/misc/sys/param.h
> index 9721613..02d6b1c 100644
> --- a/misc/sys/param.h
> +++ b/misc/sys/param.h
> @@ -99,8 +99,12 @@
> #define powerof2(x) ((((x) - 1) & (x)) == 0)
>
> /* Macros for min/max. */
> -#define MIN(a,b) (((a)<(b))?(a):(b))
> -#define MAX(a,b) (((a)>(b))?(a):(b))
> +#ifndef MIN
> +# define MIN(a,b) (((a)<(b))?(a):(b))
> +#endif
> +#ifndef MAX
> +# define MAX(a,b) (((a)>(b))?(a):(b))
> +#endif
This seems to have nothing to do with the rest of the patch.
If you have something that has its own conflicting definitions of MIN and
MAX that ends up including sys/param.h as well, and those definitions of
MIN and MAX are semantically the same as those in sys/param.h, make it
include sys/param.h directly instead of having its own definitions.
If you have something that defines MIN and MAX in ways that are
semantically different from sys/param.h, rename the conflicting macros.
> +#define __FLOAT128_OVERRIDE
> +
> +#include "../ldbl-128/ldbl2mpn.c"
Is there a reason you need a sepcial __FLOAT128_OVERRIDE macro, instead of
the approach used by the other float128 files of including
<float128_private.h>, which defines all relevant macros (e.g. defining
__mpn_extract_long_double to __mpn_extract_float128, and with the
__mpn_extract_long_double definition using _Float128 as the type name and
letting math_ldbl.h redefine that back to long double as needed)?
--
Joseph S. Myers
joseph@codesourcery.com