Re: gint64 on 64-bit architectures
- From: Daniel Elstner <daniel elstner gmx net>
- To: Tomas Ogren <stric ing umu se>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: gint64 on 64-bit architectures
- Date: 02 Apr 2002 02:50:31 +0200
Am Die, 2002-04-02 um 00.59 schrieb Tomas Ogren:
> On 01 April, 2002 - Daniel Elstner sent me these 0,6K bytes:
>
> > Hi,
> >
> > is gint64 a typedef to `long long' or just to `long' on 64-bit
> > architectures? The same question applies to guint64 as well.
> >
> > To know whether long and gint64 are always distinct types is quite
> > important in C++ code, e.g. for template specializations or function
> > overloads. Note that I assume `long long' is 64 bit wide on 64-bit
> > machines, please correct me if I'm wrong.
> >
> > I'd be nice if one of the 64bit gurus could clarify this.
>
> On 64-bit Solaris 8 with Forte 6 Update 2:
> cc -xarch=v9
> sizeof(int)=4 sizeof(long)=8 sizeof(void*)=8 sizeof(long long)=8
Thanks. Although this doesn't necessarily apply to all arch/compiler
combos, it seems to be a safe assumption for now.
I just investigated configure.in, and it seems to pick up the 'smallest'
type that fits, i.e. `long' for gint64 on 64-bit architectures. Thus,
using `long long' directly seems to be the best idea to avoid clashes.
I suppose one could always add some #ifdefs if the first 128-bit
machines conquer the mass market ;-)
Please don't hesitate to flame me if you think using `long long'
directly is a bad idea for some reason I don't know yet.
Thanks for your help,
--Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]