Re: how to tell 64 vs 32 bit architecture ?

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Sun, 09 Sep 2007 11:18:45 -0600 (MDT)
In message: <20070906111028.A83649_at_xorpc.icir.org>
            Luigi Rizzo <rizzo_at_icir.org> writes:
: 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).

It is portable.  gcc, and other compilers, define this when using
longs and pointers as 64 bit.  There's also ILP32 and ILP64
programming models, but only windows 64 uses the latter.

Typically, however, there are better ways to solve problems relating
to these differences.  What kinds of problems are you trying to solve?

Warner
Received on Sun Sep 09 2007 - 15:20:41 UTC

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