[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-c-dev
Subject:    [jira] Commented: (XERCESC-1502) xerces gets endianness wrong on Intel-based Macs
From:       "James Berry (JIRA)" <xerces-c-dev () xml ! apache ! org>
Date:       2005-09-17 2:57:54
Message-ID: 1154771014.1126925874937.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]

    [ http://issues.apache.org/jira/browse/XERCESC-1502?page=comments#action_12329603 \
] 

James Berry commented on XERCESC-1502:
--------------------------------------

I am _so_ ahead of you guys ;)

I fixed this a while ago, in checkin 190921. The 3.0 code determines endianness at \
runtime during Iniatialize, with the following code:

    // Determine our endianness (with regard to a XMLCh 16-bit word)
    union {
    	XMLCh ch;
    	unsigned char ar[sizeof(XMLCh)];
    } endianTest;
    endianTest.ch = 1;
    fgXMLChBigEndian = (endianTest.ar[sizeof(XMLCh)-1] == 1);

So you can configure once, and compile for multiple architectures, and still come out \
a winner!

(so it's fixed for 3.0, but not of course in the 2.x code).

James.

> xerces gets endianness wrong on Intel-based Macs
> ------------------------------------------------
> 
> Key: XERCESC-1502
> URL: http://issues.apache.org/jira/browse/XERCESC-1502
> Project: Xerces-C++
> Type: Bug
> Components: Miscellaneous
> Versions: Nightly build (please specify the date)
> Environment: Mac OS X on an Apple Developer Transition Kit
> Reporter: Eric Albert
> Attachments: diffs.tgz
> 
> MacOSDefs.hpp currently says this:
> // ---------------------------------------------------------------------------
> //  MacOS runs in big endian mode.
> // ---------------------------------------------------------------------------
> #define ENDIANMODE_BIG
> That's wrong, or at least out of date -- Apple is shifting to Intel-based Macs and \
> will support both PowerPC and Intel systems moving forward.  The Intel-based Macs \
> are of course little-endian.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic