diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-10-01 19:56:18 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-10-01 19:56:18 (GMT) |
commit | dfb25dd982b90403643c39b20232da5ee1283579 (patch) | |
tree | dca77ef6c844f18ec5a29167e8d3f5e844404791 /Modules/TestBigEndian.c | |
parent | 4045066f0175e82220d4abaa189b80ca15f31166 (diff) | |
download | CMake-dfb25dd982b90403643c39b20232da5ee1283579.zip CMake-dfb25dd982b90403643c39b20232da5ee1283579.tar.gz CMake-dfb25dd982b90403643c39b20232da5ee1283579.tar.bz2 |
Add test for big endian
Diffstat (limited to 'Modules/TestBigEndian.c')
-rw-r--r-- | Modules/TestBigEndian.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/TestBigEndian.c b/Modules/TestBigEndian.c new file mode 100644 index 0000000..377d1b1 --- /dev/null +++ b/Modules/TestBigEndian.c @@ -0,0 +1,10 @@ +int main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} |