From owner-freebsd-current@FreeBSD.ORG Fri Sep 7 03:07:28 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4373916A41A for ; Fri, 7 Sep 2007 03:07:28 +0000 (UTC) (envelope-from oceanare@pacific.net.sg) Received: from smtpgate1.pacific.net.sg (smtpgate1.pacific.net.sg [203.120.90.31]) by mx1.freebsd.org (Postfix) with SMTP id 618DC13C442 for ; Fri, 7 Sep 2007 03:07:27 +0000 (UTC) (envelope-from oceanare@pacific.net.sg) Received: (qmail 2173 invoked from network); 7 Sep 2007 02:39:26 -0000 Received: from bb121-7-106-120.singnet.com.sg (HELO P2120.somewherefaraway.com) (oceanare@121.7.106.120) by smtpgate1.pacific.net.sg with ESMTPA; 7 Sep 2007 02:39:25 -0000 Message-ID: <46E0B9D3.8000505@pacific.net.sg> Date: Fri, 07 Sep 2007 10:39:15 +0800 From: Erich Dollansky User-Agent: Thunderbird 2.0.0.6 (X11/20070826) MIME-Version: 1.0 To: Luigi Rizzo References: <20070906111028.A83649@xorpc.icir.org> <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> <20070906125439.A84696@xorpc.icir.org> In-Reply-To: <20070906125439.A84696@xorpc.icir.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Yan , current@freebsd.org 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 03:07:28 -0000 Hi, I have not found a method yet whic works 100% and is portable. Luigi Rizzo wrote: > On Thu, Sep 06, 2007 at 03:25:52PM -0400, Yan wrote: Consider this: >> Perhaps "if(sizeof(void*)==4) { /* 32 */} else if(sizeof(void*) ==8) { /* 64 >> */ }" ? >> and also sizeof (int) The rest will be platform specific. Erich