repo.or.cz
/
cmake.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
STYLE: Nightly Version update
[cmake.git]
/
Modules
/
TestBigEndian.c
blob
db08ceb391fcb35d4c497097556d8d80783fd274
1
#ifdef __CLASSIC_C__
2
int
main
(){
3
int
ac
;
4
char
*
av
[];
5
#else
6
int
main
(
int
ac
,
char
*
av
[]){
7
#endif
8
/* Are we little or big endian? From Harbison&Steele. */
9
union
10
{
11
long
l
;
12
char
c
[
sizeof
(
long
)];
13
}
u
;
14
u
.
l
=
1
;
15
if
(
ac
>
1000
){
return
*
av
[
0
];}
16
return
(
u
.
c
[
sizeof
(
long
) -
1
] ==
1
)?
1
:
0
;
17
}