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: Update to splay-tree.h for 64-bit Windows host


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


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