From owner-freebsd-current Sun Sep 22 19:43: 9 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45AFF37B401; Sun, 22 Sep 2002 19:43:07 -0700 (PDT) Received: from newtrinity.default-network.net (newtrinity.default-network.net [62.159.128.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C2B743E6E; Sun, 22 Sep 2002 19:43:06 -0700 (PDT) (envelope-from corex@newtrinity.default-network.net) Received: from newtrinity.default-network.net (markus@localhost [127.0.0.1]) by newtrinity.default-network.net (8.12.3/8.12.3/DEFAULT-NETWORK.NET) with ESMTP id g8N2h14H088436; Mon, 23 Sep 2002 04:43:01 +0200 (CEST) (envelope-from corex@newtrinity.default-network.net) Received: (from corex@localhost) by newtrinity.default-network.net (8.12.3/8.12.3/Submit) id g8N2h1Lp088435; Mon, 23 Sep 2002 04:43:01 +0200 (CEST) (envelope-from corex) Date: Mon, 23 Sep 2002 04:43:01 +0200 From: marius@alchemy.franken.de To: Mike Barcroft Cc: Wesley Morgan , current@FreeBSD.ORG, Alexander@Leidinger.net Subject: Re: i386 machine/endian.h Message-ID: <20020923044301.F96711@newtrinity.default-network.net> References: <20020922205448.A80510-100000@volatile.chemikals.org> <20020922214506.D91924@espresso.q9media.com> <20020922215757.E91924@espresso.q9media.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: <20020922215757.E91924@espresso.q9media.com>; from mike@FreeBSD.ORG on Sun, Sep 22, 2002 at 09:57:57PM -0400 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Sep 22, 2002 at 09:57:57PM -0400, Mike Barcroft wrote: > Mike Barcroft writes: > > Wesley Morgan writes: > > > I've been playing around with lang/icc a bit, and find it quite vexing > > > that machine/endian.h has macros that are ifdef'd around __GNUC__. The > > > intel compiler does not like the macros, partly because they are split > > > across multiple lines and possibly for other reasons. > > > > > > It seems to me that making a header actually _require_ gcc-isms is > > > something that the FreeBSD team should be working away from... Would it > > > not be possible to put make some more generic macros available as well? > > > I'm sure it's not the only instance of similar issues, but making one > > > header less gcc-dependent is a step in the right direction is it not? > > > > This was my fault. I wasn't paying attention closely to issues with > > other compilers. I've had the attached patch in my local tree for > > some time, but haven't had a chance to test it with ICC. Can you > > confirm it fixes the issues you're seeing? > > I thought about this a little bit more, and the previous patch won't > do anything unless two headers call . A new patch > which is much more likely to work is attached. Can you try this one > instead? > Works fine, please commit. > Best regards, > Mike Barcroft > Be careful not to define GCC-specific optimizations in the non-GCC > case. > > Index: endian.h > =================================================================== > RCS file: /work/repo/src/sys/i386/include/endian.h,v > retrieving revision 1.34 > diff -u -r1.34 endian.h > --- endian.h 21 Aug 2002 16:19:58 -0000 1.34 > +++ endian.h 23 Sep 2002 01:58:16 -0000 > @@ -117,11 +117,20 @@ > return (__byte_swap_word(_x)); > } > > -#endif /* __GNUC__ */ > - > #define __htonl(x) __bswap32(x) > #define __htons(x) __bswap16(x) > #define __ntohl(x) __bswap32(x) > #define __ntohs(x) __bswap16(x) > + > +#else /* !__GNUC__ */ > + > +/* > + * No optimizations are available for this compiler. Fall back to > + * non-optimized functions by defining the constant usually used to prevent > + * redefinition. > + */ > +#define _BYTEORDER_FUNC_DEFINED > + > +#endif /* __GNUC__ */ > > #endif /* !_MACHINE_ENDIAN_H_ */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message