Re: how to tell 64 vs 32 bit architecture ?

From: Luigi Rizzo <rizzo_at_icir.org>
Date: Thu, 6 Sep 2007 12:54:39 -0700
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_at_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_at_freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> >
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Thu Sep 06 2007 - 17:55:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:17 UTC