Jerome Glisse wrote:
> Hi,
> 
> Roland  pointed me to this yesterday (src/mesa/main/glheader.h):
> /*
>  * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN.
>  * Do not use them unless absolutely necessary!
>  * Try to use a runtime test instead.
>  * For now, only used by some DRI hardware drivers for color/texel packing.
>  */
> 
> So i am wondering what is best from a driver point of view,
> use this macro or use a runtime test ? Maybe this comment
> isn't revealent anymore. Any insight on this are welcome.

I'd prefer to use a run-time test since it's a little more robust (one 
less preprocessor symbol to worry about).  Though in some places we 
really do need a compile-time symbol.

Here's the code used in core Mesa:

    const GLuint ui = 1;
    const GLubyte littleEndian = *((const GLubyte *) &ui);

I should probably put that into a reusable inline function in 
imports.h ...

-Brian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to