aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/scummsys.h41
-rwxr-xr-xconfigure8
-rw-r--r--devtools/create_project/cmake.cpp4
-rw-r--r--devtools/create_project/msvc.cpp1
-rw-r--r--engines/director/lingo/lingo.h8
-rw-r--r--engines/fullpipe/utils.h8
6 files changed, 29 insertions, 41 deletions
diff --git a/common/scummsys.h b/common/scummsys.h
index 432dd74fa7..42fcdf79dd 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -310,26 +310,6 @@
#endif
//
-// Determine 64 bitness
-// Reference: http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros
-//
-#if !defined(HAVE_CONFIG_H)
-
- #if defined(__x86_64__) || \
- defined(_M_X64) || \
- defined(__ppc64__) || \
- defined(__powerpc64__) || \
- defined(__LP64__)
-
- #if !defined(SCUMM_64BITS)
- #define SCUMM_64BITS
- #endif
-
- #endif
-
-#endif
-
-//
// Some more system specific settings.
// TODO/FIXME: All of these should be moved to backend specific files (such as portdefs.h)
//
@@ -452,6 +432,27 @@
#endif
#endif
+//
+// Determine 64 bitness
+// Reference: http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros
+//
+#if !defined(HAVE_CONFIG_H)
+
+#if defined(__x86_64__) || \
+ defined(_M_X64) || \
+ defined(__ppc64__) || \
+ defined(__powerpc64__) || \
+ defined(__LP64__)
+
+typedef uint64 uintptr;
+
+#else
+
+typedef uint32 uintptr;
+
+#endif
+
+#endif
//
// Overlay color type (FIXME: shouldn't be declared here)
diff --git a/configure b/configure
index df9ac16eba..d2c1d1abbe 100755
--- a/configure
+++ b/configure
@@ -2149,13 +2149,11 @@ EOF
echo_n "Checking 64-bitness... "
pointer_is_32bit
if test $? -eq 0; then
- type_ptr=int32
+ type_ptr=uint32
echo "no"
- add_line_to_config_h "/* #define SCUMM_64BITS */"
else
- type_ptr=int64
+ type_ptr=uint64
echo "yes"
- add_line_to_config_h "#define SCUMM_64BITS"
fi
#
@@ -5188,6 +5186,8 @@ typedef signed $type_2_byte int16;
typedef signed $type_4_byte int32;
typedef signed $type_8_byte int64;
+typedef $type_ptr uintptr;
+
#if defined(__APPLE__) && !defined(__ppc__)
#ifndef _UINT64
#define _UINT64
diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp
index dfa54875be..9be76f9fe8 100644
--- a/devtools/create_project/cmake.cpp
+++ b/devtools/create_project/cmake.cpp
@@ -242,10 +242,6 @@ void CMakeProvider::writeDefines(const BuildSetup &setup, std::ofstream &output)
output << " add_definitions(-DPOSIX)\n";
output << "endif()\n";
- output << "if (CMAKE_SIZEOF_VOID_P MATCHES 8)\n";
- output << " add_definitions(-DSCUMM_64BITS)\n";
- output << "endif()\n";
-
output << "add_definitions(-DSDL_BACKEND)\n\n";
}
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index 64f3472697..e6b47fe724 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -158,7 +158,6 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
// HACK: This definitely should not be here, but otherwise we would not define SDL_BACKEND for x64.
x64Defines.push_back("WIN32");
x64Defines.push_back("SDL_BACKEND");
- x64Defines.push_back("SCUMM_64BITS");
outputGlobalPropFile(setup, properties, 64, x64Defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents);
}
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 6cf7ceb923..479f8855a9 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -92,12 +92,8 @@ struct Pointer_EqualTo {
struct Pointer_Hash {
uint operator()(const void *x) const {
-#ifdef SCUMM_64BITS
- uint64 v = (uint64)x;
- return (v >> 32) ^ (v & 0xffffffff);
-#else
- return (uint)x;
-#endif
+ uint x = static_cast<uint>(reinterpret_cast<uintptr>(v));
+ return x + (x >> 3);
}
};
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h
index bb8c9651da..e53db3d26a 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -38,12 +38,8 @@ struct Pointer_EqualTo {
struct Pointer_Hash {
uint operator()(const void *x) const {
-#ifdef SCUMM_64BITS
- uint64 v = (uint64)x;
- return (v >> 32) ^ (v & 0xffffffff);
-#else
- return (uint)x;
-#endif
+ uint x = static_cast<uint>(reinterpret_cast<uintptr>(v));
+ return x + (x >> 3);
}
};