Fix endianess detection

This commit is contained in:
mio 2022-11-16 15:16:49 +01:00
parent 5f5ef1546c
commit e9c1c17f6d
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
2 changed files with 15 additions and 6 deletions

View File

@ -29,7 +29,7 @@ SRC_DIR = os.path.join(ROOT_DIR, 'src')
UC_DIR = SRC_DIR if os.path.exists(SRC_DIR) else os.path.join(ROOT_DIR, '../..')
BUILD_DIR = os.path.join(UC_DIR, 'build_python')
VERSION = "2.0.1"
VERSION = "2.0.1.post1"
if SYSTEM == 'darwin':
LIBRARY_FILE = "libunicorn.2.dylib"

View File

@ -41,7 +41,8 @@
# elif (__BYTE_ORDER == __PDP_ENDIAN)
# define BOOST_PDP_ENDIAN
# else
# error Unknown machine endianness detected.
// Failsafe
# define BOOST_LITTLE_ENDIAN
# endif
# define BOOST_BYTE_ORDER __BYTE_ORDER
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
@ -50,11 +51,14 @@
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
// https://developer.arm.com/documentation/dui0491/i/Compiler-specific-Features/Predefined-macros
#elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|| defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__)
|| defined(__s390__) \
|| defined(__ARMEB__) || defined(__AARCH64EB__) \
|| defined(__BIG_ENDIAN) || defined(__ARM_BIG_ENDIAN)
# define BOOST_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321
#elif defined(__i386__) || defined(__alpha__) \
@ -63,12 +67,17 @@
|| defined(_M_ALPHA) || defined(__amd64) \
|| defined(__amd64__) || defined(_M_AMD64) \
|| defined(__x86_64) || defined(__x86_64__) \
|| defined(_M_X64) || defined(__bfin__)
|| defined(_M_X64) || defined(__bfin__) \
|| defined(__ARMEL__) || defined(__AARCH64EL__) \
|| defined(__arm64__) || defined(__arm__)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#else
# error The file boost/detail/endian.hpp needs to be set up for your CPU type.
// Failsafe
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#endif