You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Ralf S. Engelschall" <rs...@engelschall.com> on 1999/06/02 15:12:18 UTC

Err... Expat and XML_BYTE_ORDER!

Err.. friends: I've recognized that for the expat-lite stuff no byte order
determination was added to our Configure stuff.

rse@en1:/e/apache/SRC/apache-1.3/src/lib/expat-lite
:> grep XML_BYTE_ORDER *.c
xmltok.c:#if XML_BYTE_ORDER == 12
xmltok.c:#if XML_BYTE_ORDER == 12
xmltok.c:#if XML_BYTE_ORDER != 21
xmltok.c:#if XML_BYTE_ORDER == 21
xmltok.c:#if XML_BYTE_ORDER == 21
xmltok.c:#if XML_BYTE_ORDER != 12
xmltok_ns.c:#if XML_BYTE_ORDER == 12
xmltok_ns.c:#elif XML_BYTE_ORDER == 21

So, we've to add this byte order stuff or Expat will fail on some platforms,
of course. The old way of James Clark (just saying in the Makefile the user
should specify the byte odering) isn't acceptable, of ocurse.

For details on how this can be achieved look at the AC_C_BIGENDIAN macro of
Autoconf. In short: It checks some headers for endian macros and if all fails
it compiles a little test program to find it out.

Or can we fix this more easily?
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Re: Err... Expat and XML_BYTE_ORDER!

Posted by Greg Stein <gs...@lyra.org>.
Ralf S. Engelschall wrote:
> 
> Err.. friends: I've recognized that for the expat-lite stuff no byte order
> determination was added to our Configure stuff.
> ...
> So, we've to add this byte order stuff or Expat will fail on some platforms,
> of course.

No... NOT of course.

That define is an optimization. The library works fine without it.

> The old way of James Clark (just saying in the Makefile the user
> should specify the byte odering) isn't acceptable, of ocurse.

Agreed.

> For details on how this can be achieved look at the AC_C_BIGENDIAN macro of
> Autoconf. In short: It checks some headers for endian macros and if all fails
> it compiles a little test program to find it out.
> 
> Or can we fix this more easily?

The easy fix is to do exactly what I did: punt on trying to
automatically set the variable. The more optimal fix is what you
describe: have a #define which is set by the configuration process.

-g

--
Greg Stein, http://www.lyra.org/