From owner-freebsd-current@FreeBSD.ORG Fri Sep 7 06:24:51 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0C3716A418 for ; Fri, 7 Sep 2007 06:24:51 +0000 (UTC) (envelope-from spawk@acm.poly.edu) Received: from acm.poly.edu (acm.poly.edu [128.238.9.200]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0FD13C469 for ; Fri, 7 Sep 2007 06:24:51 +0000 (UTC) (envelope-from spawk@acm.poly.edu) Received: (qmail 88164 invoked from network); 7 Sep 2007 05:59:40 -0000 Received: from unknown (HELO ?192.168.0.2?) (spawk@69.123.41.145) by acm.poly.edu with AES256-SHA encrypted SMTP; 7 Sep 2007 05:59:40 -0000 Message-ID: <46E0E85E.3080809@acm.poly.edu> Date: Fri, 07 Sep 2007 01:57:50 -0400 From: Boris Kochergin User-Agent: Thunderbird 2.0.0.0 (X11/20070609) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: how to tell 64 vs 32 bit architecture ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2007 06:24:51 -0000 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