From owner-freebsd-current Fri Oct 27 8:29: 2 2000 Delivered-To: freebsd-current@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 477CB37B4C5; Fri, 27 Oct 2000 08:28:47 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.0/8.11.0) id e9RFRwH42009; Fri, 27 Oct 2000 18:27:58 +0300 (EEST) (envelope-from ru) Date: Fri, 27 Oct 2000 18:27:58 +0300 From: Ruslan Ermilov To: Mike Smith , Bruce Evans , Konstantin Chuguev , Brian Somers , kargl@apl.washington.edu, freebsd-current@FreeBSD.org Subject: Re: platform byte order macros? Message-ID: <20001027182758.A41742@sunbay.com> Mail-Followup-To: Mike Smith , Bruce Evans , Konstantin Chuguev , Brian Somers , kargl@apl.washington.edu, freebsd-current@FreeBSD.org References: <20001027160724.A29559@sunbay.com> <200010271434.e9REY6F00412@mass.osd.bsdi.com> <20001027181149.B39062@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001027181149.B39062@sunbay.com>; from ru@FreeBSD.org on Fri, Oct 27, 2000 at 06:11:49PM +0300 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Oct 27, 2000 at 06:11:49PM +0300, Ruslan Ermilov wrote: > On Fri, Oct 27, 2000 at 07:34:06AM -0700, Mike Smith wrote: > > > On Fri, Oct 27, 2000 at 09:49:57PM +1100, Bruce Evans wrote: > > > [...] > > > > > > > > NetBSD supports the ntohl family on constants, but only on some arches > > > > (at least in last year's version). It takes fancier macros to support > > > > constants. This gives an excuse to change the inline functions back to > > > > macros :-). > > > > > > > Cool! My upcoming byte-swapping changes to IPv4 code would benefit from > > > having these macros. Could you please review the attached patch (it was > > > obtained from NetBSD)? > > ... > > > +#ifdef __OPTIMIZE__ > > > > Using macros does not "optimise" anything, and this is a very poor choice > > of defines. __MACRO_ENDIAN_CONVERSIONS might be better. > > > Huh, you would not call this optimization?! > Just thought that you raised another issue here, the choice of __OPTIMIZE__. If that's the case, it is the GCC's define used to indicate the optimizing compilation: # cpp -O -dM /dev/null #define __FreeBSD__ 4 #define __FreeBSD_cc_version 410000 #define __i386__ 1 #define __i386 1 #define i386 1 #define __OPTIMIZE__ 1 #define __unix 1 #define __unix__ 1 #define __ELF__ 1 #define unix 1 -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message