Determine endianness at compile time
This commit is contained in:
parent
d9dec2c027
commit
77de1c473a
@ -1602,16 +1602,13 @@ vips_ispoweroftwo( int p )
|
|||||||
int
|
int
|
||||||
vips_amiMSBfirst( void )
|
vips_amiMSBfirst( void )
|
||||||
{
|
{
|
||||||
int test;
|
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||||
unsigned char *p = (unsigned char *) &test;
|
return( 1 );
|
||||||
|
#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||||
test = 0;
|
return( 0 );
|
||||||
p[0] = 255;
|
#else
|
||||||
|
#error "Byte order not recognised"
|
||||||
if( test == 255 )
|
#endif
|
||||||
return( 0 );
|
|
||||||
else
|
|
||||||
return( 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the tmp dir. On Windows, GetTempPath() will also check the values of
|
/* Return the tmp dir. On Windows, GetTempPath() will also check the values of
|
||||||
|
Loading…
Reference in New Issue
Block a user