diff --git a/CMakeLists.txt b/CMakeLists.txt index c5e339ad5c..03f5bf2368 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -536,6 +536,10 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) add_definitions(-DPOINTER_IS_64BIT) endif() +if(OPTION_NO_TAGGED_PTRS) + add_definitions(-DNO_TAGGED_PTRS) +endif() + enable_testing() add_subdirectory(regression) diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp index 418e29f027..89c47e4956 100644 --- a/src/core/endian_type.hpp +++ b/src/core/endian_type.hpp @@ -27,7 +27,7 @@ # error "TTD_ENDIAN is not defined; please set it to either TTD_LITTLE_ENDIAN or TTD_BIG_ENDIAN" #endif /* !TTD_ENDIAN */ -#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) +#if !defined(NO_TAGGED_PTRS) && (defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64)) /** Tagged pointers (upper bits) may be used on this architecture */ # define OTTD_UPPER_TAGGED_PTR 1 #else