DEADSOFTWARE
GIT
/
REPO
/
FRED-BOY
Projects
/
odcread.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Bla
[odcread.git]
/
util.cc
1
#include <oberon.h>
2
3
namespace
odc
{
4
bool
isBigEndian
() {
// http://stackoverflow.com/questions/1001307/detecting-endianness-programmatically-in-a-c-program
5
union
{
6
uint32_t
i
;
7
uint8_t
c
[
4
];
8
}
test
= {
0x01020304
};
9
return
test
.
c
[
0
] ==
1
;
10
}
11
12
bool
isLittleEndian
() {
13
return
!
isBigEndian
();
14
}
15
}