[Bf-committers] Re: image editor / draw alpha

Ed Halley ed at halley.cc
Wed Jun 14 03:16:20 CEST 2006


On Jun 13, 2006, at 7:47 PM, Branan Riley wrote:
> I'm running Gentoo Linux x86-64 on a Pentium 4, so endianness is
> probably the issue. I don't think testing for the Mac OS define would
> work, since there are also Intel-based macs. Does anyoen know the
> right define to check for to distinguish endianness?

The current patch* for Mac Intel endianness looks for each of these:

    #if ... || defined(__APPLE__)

and turns them into

    #if ... || (defined(__APPLE__) && !defined(__LITTLE_ENDIAN__))

Similar adjustments are made in a couple makefiles.

I am all for defining a better symbol to drive these checks, but this  
seems to work for the few CLEARLY UNDERSTOOD endian issues.

It is important for any code that deals with byte packing to be CLEAR  
about its intentions.  This "it works because alpha is the low byte  
of an int" stuff can't be sufficient.  More rigorous testing is  
needed, and developers can't get complacent about assuming that all  
machines work the same way that their favorite machine works.

* (the current patch being what was passed around unofficially as
    'dougcorrs.diff' but never got posted on the patch server)

--
[ e d @ h a l l e y . c c ]






More information about the Bf-committers mailing list