Re: [AD] OSX qtmidi.m build failure fix

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sunday 16 April 2006 03:54, Peter Hull wrote:
> On 4/15/06, Miguel A. Gavidia <juvinious@xxxxxxxxxx> wrote:
> > Ok my output is this:
> > TARGET_RT_BIG_ENDIAN = 0
> > TARGET_RT_LITTLE_ENDIAN = 1
> >
> > You know though it doesn't matter though, either doing:
> > #if or #ifndef TARGET_RT_BIG_ENDIAN
> > will work either way.
> > As one is defined for each, so either platform won't have both.
> > ie:
> > ppc will only have TARGET_RT_BIG_ENDIAN
> > x86 will only have TARGET_RT_LITTLE_ENDIAN
>
> No, both are defined for both.
> On PPC, I get
>
> TARGET_RT_BIG_ENDIAN = 1
> TARGET_RT_LITTLE_ENDIAN = 0
>
> So #ifdef wouldn't work, for example
>
> #ifdef TARGET_RT_BIG_ENDIAN
> big_endian_code();
> #else
> little_endian_code();
> #endif
>
> would run big_endian_code() even on little-endian platforms.
>
> Hope that makes sense.
>
> Pete
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live
> webcast and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642

Either way your patch was fine.
I would go ahead and commit that, you said it worked on ppc? It worked fine on 
x86, the change to #ifndef is unnecessary and would lead to problems as you 
said. Makes sense to me. :)

ie:
#if TARGET_RT_BIG_ENDIAN
..
#else
..
#endif

-- 
-juvinious

<a href="http://chasm.hopto.org";>The Chasm</a> - My Site.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/