Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Sep 2007 01:57:50 -0400
From:      Boris Kochergin <spawk@acm.poly.edu>
To:        freebsd-current@freebsd.org
Subject:   Re: how to tell 64 vs 32 bit architecture ?
Message-ID:  <46E0E85E.3080809@acm.poly.edu>

next in thread | raw e-mail | index | archive | help
I don't know about 100% portable, but the following works across 
FreeBSD, Linux, and Solaris since at least GCC 2.95: __LONG_BIT (as 
found in /usr/include/machine/_limits.h on FreeBSD) is #defined as 32 on 
32-bit machines and 64 on 64-bit machines. I suspect it may even be part 
of a standard as the comments at the top of that file indicate so.

-Boris



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