how to tell 64 vs 32 bit architecture ?

Yan rottled at gmail.com
Thu Sep 6 12:50:46 PDT 2007


Perhaps "if(sizeof(void*)==4) { /* 32 */} else if(sizeof(void*) ==8) { /* 64
*/ }" ?

Or do you need something for the preprocessor?

-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"
>


More information about the freebsd-current mailing list