From owner-freebsd-current@FreeBSD.ORG Thu Sep 6 19:55:55 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 5256A16A417 for ; Thu, 6 Sep 2007 19:55:55 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id 2C68D13C46B for ; Thu, 6 Sep 2007 19:55:55 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l86JsdMV084754; Thu, 6 Sep 2007 12:54:39 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l86Jsdki084753; Thu, 6 Sep 2007 12:54:39 -0700 (PDT) (envelope-from rizzo) Date: Thu, 6 Sep 2007 12:54:39 -0700 From: Luigi Rizzo To: Yan Message-ID: <20070906125439.A84696@xorpc.icir.org> References: <20070906111028.A83649@xorpc.icir.org> <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com>; from rottled@gmail.com on Thu, Sep 06, 2007 at 03:25:52PM -0400 Cc: 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: Thu, 06 Sep 2007 19:55:55 -0000 On Thu, Sep 06, 2007 at 03:25:52PM -0400, Yan wrote: > Perhaps "if(sizeof(void*)==4) { /* 32 */} else if(sizeof(void*) ==8) { /* 64 > */ }" ? > > Or do you need something for the preprocessor? preprocessor. cheers luigi > -yan > > On 9/6/07, Luigi Rizzo wrote: > > > > 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). > > > > cheers > > luigi > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"