Re: platform byte order macros?

2000-10-31 Thread Ruslan Ermilov
On Sat, Oct 28, 2000 at 04:13:46PM +1100, Bruce Evans wrote: On Fri, 27 Oct 2000, Ruslan Ermilov wrote: 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: +#ifdef __OPTIMIZE__ Using macros does not

Re: platform byte order macros?

2000-10-31 Thread Bruce Evans
On Tue, 31 Oct 2000, Ruslan Ermilov wrote: On Sat, Oct 28, 2000 at 04:13:46PM +1100, Bruce Evans wrote: On Fri, 27 Oct 2000, Ruslan Ermilov wrote: 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:

platform byte order macros?

2000-10-27 Thread Konstantin Chuguev
Hi, AFAICS ntoh[ls] and hton[ls] defined as asm instructions. This prevents using them in const variables initialisation. I need to create a const unsigned char array[] (C source file) from quite a big network byte ordered binary data. Although the data consists mainly of bytes and 16- and

Re: platform byte order macros?

2000-10-27 Thread Bruce Evans
On Fri, 27 Oct 2000, Konstantin Chuguev wrote: AFAICS ntoh[ls] and hton[ls] defined as asm instructions. This prevents using them in const variables initialisation. They are normally implemented using asm, but their man page just hints that they are functions by giving prototypes for them.

Re: platform byte order macros?

2000-10-27 Thread Ruslan Ermilov
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

Re: platform byte order macros?

2000-10-27 Thread Mike Smith
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

Re: platform byte order macros?

2000-10-27 Thread Ruslan Ermilov
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.

Re: platform byte order macros?

2000-10-27 Thread Ruslan Ermilov
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

Re: platform byte order macros?

2000-10-27 Thread Mike Smith
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

Re: platform byte order macros?

2000-10-27 Thread Bruce Evans
On Fri, 27 Oct 2000, Ruslan Ermilov wrote: 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: +#ifdef __OPTIMIZE__ Using macros does not "optimise" anything, Not quite true. Using inline functions pessimizes