aboutsummaryrefslogtreecommitdiff
path: root/tools/iDSK/src/endianPPC.cpp
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-05-03 08:21:10 +0100
committerJuan J. Martinez <jjm@usebox.net>2021-05-03 10:00:00 +0100
commitc3b0fa04a663fe233765b83d3be41a42aa08c25d (patch)
tree0befda349001ef6ce306b39378f9c70ad917363e /tools/iDSK/src/endianPPC.cpp
downloadreturn-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.tar.gz
return-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.zip
Initial import for public releaseHEADmain
Diffstat (limited to 'tools/iDSK/src/endianPPC.cpp')
-rw-r--r--tools/iDSK/src/endianPPC.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/iDSK/src/endianPPC.cpp b/tools/iDSK/src/endianPPC.cpp
new file mode 100644
index 0000000..7b51225
--- /dev/null
+++ b/tools/iDSK/src/endianPPC.cpp
@@ -0,0 +1,20 @@
+#include <iostream>
+#include <cstdlib>
+using namespace std;
+#include "endianPPC.h"
+
+#ifndef _MSC_VER
+#include <sys/param.h>
+#include <endian.h>
+#endif
+
+bool isBigEndian(void)
+{
+#ifdef BYTE_ORDER
+ return BYTE_ORDER == BIG_ENDIAN;
+#elif defined _MSC_VER
+ return true; // It doesn't run on anything except x86, right?
+#else
+ return __BYTE_ORDER == __BIG_ENDIAN;
+#endif
+}