Date: Thu, 6 Sep 2007 15:25:52 -0400 From: Yan <rottled@gmail.com> To: "Luigi Rizzo" <rizzo@icir.org> Cc: current@freebsd.org Subject: Re: how to tell 64 vs 32 bit architecture ? Message-ID: <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> In-Reply-To: <20070906111028.A83649@xorpc.icir.org> References: <20070906111028.A83649@xorpc.icir.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54b90fdf0709061225q48af11c2yca8d330eff514159>