projects
/
gapil.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
9929323304a1fba1cdde4cb96c49be10e3acbf4a
[gapil.git]
/
endian.c
1
int endian(void)
2
{
3
/*
4
* Variables definition
5
*/
6
short magic, test;
7
char * ptr;
8
9
magic = 0xABCD; /* endianess magic number */
10
ptr = (char *) &magic;
11
test = (ptr[1]<<8) + (ptr[0]&0xFF); /* build value byte by byte */
12
return (magic == test); /* if the same is little endian */
13
}