This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC v2][2/2] Target FP: Make use of MPFR if available


John Baldwin wrote:

> FreeBSD's stdint.h uses _SYS_STDINT_H_ as it's include guard for <stdint.h>,
> so this check doesn't work.  Perhaps GDB's sources should just define
> MPFR_USE_INTMAX_T explicitly after ensuring <stdint.h> is included?  That
> would seem to be the most portable approach and I think is what the
> "Portable software should not rely on these tests" implies.

I agree.  GDB now requires C++11, which always has intmax_t, so it should
be fine to simply always require this.

> target-float.c always includes <stdint.h> via "defs.h" ->
> "common/common-defs.h", so just adding the #define should be sufficient.
> 
> Indeed, this does fix the build on FreeBSD:
> 
> diff --git a/gdb/target-float.c b/gdb/target-float.c
> index 32237ec9d9..b40b6416c1 100644
> --- a/gdb/target-float.c
> +++ b/gdb/target-float.c
> @@ -1147,6 +1147,8 @@ host_float_ops<T>::compare (const gdb_byte *x, const
> struct type *type_x,
> 
>  #ifdef HAVE_LIBMPFR
> 
> +#define MPFR_USE_INTMAX_T
> +
>  #include <mpfr.h>
> 
>  class mpfr_float_ops : public target_float_ops

This looks good to me.  Can you check this in?

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]