I wouldn't do it like that. You are executing a function call and all that is
requrired is a simple test.
I'd do it something like this probably:
static union endian
{ int i;
char little;
} is_endian;
Then in an initializationb routine:
is_endian.i = 1;
and where I need it:
if (is_endian.little)
{
printf("little endian");
}
else
{
printf("big endian");
}
On Sun, 26 Sep 1999 11:52:37 +0200, Andy Polyakov wrote:
>> > I will funrish a function to detect the endian order if requested.
>> int is_bigendian() { static int i=1; return (int)(*(char *)&i); }
>oops! it's of course is_littleendian:-) Andy.
>______________________________________________________________________
>OpenSSL Project http://www.openssl.org
>Development Mailing List [EMAIL PROTECTED]
>Automated List Manager [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]