From owner-freebsd-current@FreeBSD.ORG Fri Sep 7 15:21:24 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 5220816A468 for ; Fri, 7 Sep 2007 15:21:24 +0000 (UTC) (envelope-from fabio@freebsd.org) Received: from sssup.it (ms01.sssup.it [193.205.80.99]) by mx1.freebsd.org (Postfix) with ESMTP id DF9E513C45A for ; Fri, 7 Sep 2007 15:21:23 +0000 (UTC) (envelope-from fabio@freebsd.org) Received: from [10.30.3.4] (HELO granpasso.retis) by sssup.it (CommuniGate Pro SMTP 4.1.8) with SMTP id 33656854 for current@freebsd.org; Fri, 07 Sep 2007 16:10:53 +0200 Received: (qmail 45522 invoked from network); 7 Sep 2007 14:21:11 -0000 Received: from unknown (HELO granpasso.retis) (127.0.0.1) by localhost.retis with SMTP; 7 Sep 2007 14:21:11 -0000 Received: (from fabio@localhost) by granpasso.retis (8.14.1/8.14.1/Submit) id l87EL9LV045520; Fri, 7 Sep 2007 16:21:09 +0200 (CEST) (envelope-from fabio@freebsd.org) X-Authentication-Warning: granpasso.retis: fabio set sender to fabio@freebsd.org using -f Date: Fri, 7 Sep 2007 16:21:09 +0200 From: Fabio Checconi To: Luigi Rizzo Message-ID: <20070907142109.GL30045@gandalf.sssup.it> References: <20070906111028.A83649@xorpc.icir.org> <20070906222647.GB2737@kobe.laptop> <20070907000950.A91211@xorpc.icir.org> <20070907115021.GA2718@kobe.laptop> <20070907050310.A94579@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070907050310.A94579@xorpc.icir.org> User-Agent: Mutt/1.4.2.3i Cc: Giorgos Keramidas , 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 15:21:24 -0000 On Fri, Sep 07, 2007 at 05:03:10AM -0700, Luigi Rizzo wrote: > i need to do this: > > #ifdef BUILT_FOR_64BIT_POINTERS > #define MY_MAGIC 0xdeadbeefd00de123 /* 64 bit */ > #else > #define MY_MAGIC 0xdeadbeef /* 32 bit */ > > If you know of a way to implement this without preprocessor > magic, i am all ears. If the values were simpler (eg all ones or so) > i could have used ~((unitptr_t)0) but this is not the case here #include #if UINTPTR_MAX < 0xdeadbeefd00de123 /* <= 0xffffffff */ #define MY_MAGIC 0xdeadbeef #else #define MY_MAGIC 0xdeadbeefd00de123 #endif does something like that look good to you ? fabio