[quake3] Re: Running q3ded on PPC

Chad Gatesman cgatesman at gmail.com
Tue Nov 1 10:25:00 EST 2005


I get the same thing on my Sparc, but if I modify your code:

int main( void )
{
#ifndef __FLOAT_WORD_ORDER
printf( "Q3 has no clue!\n" );
return 0;
#endif

printf( "Q3 thinks this machine is " );

#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
printf( "little endian\n" );
#else
printf( "big endian\n" );
#endif

return 0;
}


I get:

bacardi:/tmp> ./a.out
Q3 has no clue!

I just checked a couple other architectures (ai32, Alpha, Power4), and I
can't find __FLOAT_WORD_ORDER or __LITTLE_ENDIAN defined on any machine.
This is why the test chooses little--because they are both undefined
therefore equal one another. Perhaps a more generic #define should be used
in the code, and the appropriate value be set for each arch in the Makefile.

I guess I was lucky when building on my Alpha as it is little endian.


On 11/1/05, vincent at cojot.name <vincent at cojot.name> wrote:
>
>
> You know, This PPC problem made me realize something as Solaris/Sparc
> suffers from the same symptoms as PPC (no VM_compiled, using interpreter
> and then a sig 10 or sig 11).
>
> When running q3_endian_test on Solaris/Sparc it resulted in:
>
> raistlin at ergoth:[/net/thorbardin/export/home/raistlin ]cat q3_endian.c
> #include <assert.h>
> #include <math.h>
> #include <stdio.h>
> #include <stdarg.h>
> #include <string.h>
> #include <stdlib.h>
> #include <time.h>
> #include <ctype.h>
> #include <limits.h>
> #include <stdio.h>
>
> int main( void )
> {
> printf( "Q3 thinks this machine is " );
>
> #if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
> printf( "little endian\n" );
> #else
> printf( "big endian\n" );
> #endif
>
> return 0;
> }
>
> raistlin at ergoth:[/net/thorbardin/export/home/raistlin ]./q3_endian
> Q3 thinks this machine is little endian
>
> Obviously this is wrong for Solaris/Sparc and __FLOAT_WORD_ORDER is
> nowhere to be defined anyway.. I'll be checking the #ifdef in the VM
> stuff..
>
> Vincent
>



--
Chad Gatesman
http://gatesman.dyndns.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/quake3/attachments/20051101/0a24638b/attachment.htm>


More information about the quake3 mailing list