From owner-freebsd-current@FreeBSD.ORG Thu Sep 6 19:50:45 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 E62D116A418 for ; Thu, 6 Sep 2007 19:50:45 +0000 (UTC) (envelope-from rottled@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id 78D4913C49D for ; Thu, 6 Sep 2007 19:50:45 +0000 (UTC) (envelope-from rottled@gmail.com) Received: by nf-out-0910.google.com with SMTP id k4so222401nfd for ; Thu, 06 Sep 2007 12:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=x4IsJ78f+dNc98XUxN5CIiQvfIrn/vR92LSCgdjPtlI=; b=RZrEHTMSnaDVR9VzW486k/ziBymYIiQcl3UXp5+UAlJSOSPBEqR4m7i/JBPRlsVuTk0u7gRGVUbqI3R0tCOuRd9GUBAluzfaU4fjAPEabVS+iIKQJYcr2uWRIqFNCg9jWNnRRF8y6JU4PWteygUamLeMpOQfYk9/b63smvpBL2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mCZ8jO78fJqLAtAVfnJ7Dmzk3Jgrw3LJghP1HPJ7bXtfev51RiJA9gLmKlmFd0haM6/PL14ltL+J3sorNZuJgFBdO+unhdkc1jbWfSR/4hA16mKxKyQp+vTS7lLfbgj/bLNm/5eN2sVdy2fzPzmceLhQBa3NhV+g+WZTdVf76CU= Received: by 10.86.84.5 with SMTP id h5mr826625fgb.1189106752542; Thu, 06 Sep 2007 12:25:52 -0700 (PDT) Received: by 10.86.25.18 with HTTP; Thu, 6 Sep 2007 12:25:52 -0700 (PDT) Message-ID: <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> Date: Thu, 6 Sep 2007 15:25:52 -0400 From: Yan To: "Luigi Rizzo" In-Reply-To: <20070906111028.A83649@xorpc.icir.org> MIME-Version: 1.0 References: <20070906111028.A83649@xorpc.icir.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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:50:46 -0000 Perhaps "if(sizeof(void*)==4) { /* 32 */} else if(sizeof(void*) ==8) { /* 64 */ }" ? Or do you need something for the preprocessor? -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" >