Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2007 12:54:39 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        Yan <rottled@gmail.com>
Cc:        current@freebsd.org
Subject:   Re: how to tell 64 vs 32 bit architecture ?
Message-ID:  <20070906125439.A84696@xorpc.icir.org>
In-Reply-To: <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com>; from rottled@gmail.com on Thu, Sep 06, 2007 at 03:25:52PM -0400
References:  <20070906111028.A83649@xorpc.icir.org> <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 06, 2007 at 03:25:52PM -0400, Yan wrote:
> Perhaps "if(sizeof(void*)==4) { /* 32 */} else if(sizeof(void*) ==8) { /* 64
> */ }" ?
> 
> Or do you need something for the preprocessor?

preprocessor.

cheers
luigi

> -yan
> 
> On 9/6/07, Luigi Rizzo <rizzo@icir.org> wrote:
> >
> > hi,
> > i was wondering what is the proper way to tell a 64 vs 32 bit
> > architecture.
> >
> > I see that some code in sys/ uses  ' #ifdef __LP64__ ' but i am not
> > sure if this is generic enough (ie not gcc or FreeBSD specific),
> > and also suitable for userland (i.e. works on linux or other platforms
> > as well).
> >
> >         cheers
> >         luigi
> > _______________________________________________
> > freebsd-current@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
> >
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070906125439.A84696>