This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Update to splay-tree.h for 64-bit Windows host
- From: Ian Lance Taylor <iant at google dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gdb-patches at sourceware dot org
- Date: 12 Jul 2007 18:08:24 -0700
- Subject: Re: Update to splay-tree.h for 64-bit Windows host
- References: <m3vecqoznm.fsf@redhat.com> <m3tzs9f80m.fsf@localhost.localdomain>
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