Update to splay-tree.h for 64-bit Windows host

Ian Lance Taylor iant@google.com
Fri Jul 13 01:09:00 GMT 2007


Ian Lance Taylor <iant@google.com> writes:

> Nick Clifton <nickc@redhat.com> writes:
> 
> > +#ifndef _WIN64
> > +  typedef unsigned long int libi_uhostptr_t;
> > +  typedef long int libi_shostptr_t;
> > +#else
> > +  typedef unsigned long long libi_uhostptr_t;
> > +  typedef long long libi_shostptr_t;
> > +#endif
> 
> I think we should instead use a configure test to see whether
> <stdint.h> exists and defines uintptr_t and intptr_t.  We should use
> those when they exist.  If they don't, we should do something like
> 
> #ifdef __GNUC__
> typedef unsigned int libi_uhostptr_t __attribute__ ((mode (pointer)));
> typedef int libi_shostptr_t __attribute__ ((mode (pointer)));
> #else
> typedef unsigned long long libi_uhostptr_t;
> typedef long long libi_shostptr_t;
> #endif
> 
> Ideally we don't have to test _WIN64 at all.

Oh, I see, these types need to be large enough to hold a pointer or
any scalar type, even HOST_WIDE_INT which can be "long long".  This is
kind of ugly.  I think this interface needs an overhaul.

Ian



More information about the Gdb-patches mailing list