blob: f3146d674d09c5d5103769903a9a63944fc3dd09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <iostream>
#include <cstdlib>
using namespace std;
#include "endianPPC.h"
#ifndef _MSC_VER
#include <sys/param.h>
#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__MORPHOS__)
#include <machine/endian.h>
#else
#include <endian.h>
#endif
#endif
bool isBigEndian(void)
{
#ifdef BYTE_ORDER
return BYTE_ORDER == BIG_ENDIAN;
#elif defined _MSC_VER
return false; // Modern VC++ only runs on x86, x64 and ARM, doesn't require big/little endian conversion
#else
return __BYTE_ORDER == __BIG_ENDIAN;
#endif
}
|