how to tell 64 vs 32 bit architecture ?

Boris Kochergin spawk at acm.poly.edu
Thu Sep 6 23:24:51 PDT 2007


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


More information about the freebsd-current mailing list