[Scummvm-cvs-logs] scummvm master -> 00242281006dd26204a3b438f1ecb38928bfb75f

sev- sev at scummvm.org
Sun Jan 8 23:30:17 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0024228100 CONFIGURE: Add detection for 64-bitness and define int64 when applicable


Commit: 00242281006dd26204a3b438f1ecb38928bfb75f
    https://github.com/scummvm/scummvm/commit/00242281006dd26204a3b438f1ecb38928bfb75f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-01-08T14:28:43-08:00

Commit Message:
CONFIGURE: Add detection for 64-bitness and define int64 when applicable

Changed paths:
    configure



diff --git a/configure b/configure
index f01c009..1be4284 100755
--- a/configure
+++ b/configure
@@ -1706,6 +1706,35 @@ EOF
 }
 
 #
+# Check whether the system is 32-bit
+#
+pointer_is_32bit() {
+        cat > tmp_pointer_is_32bit.cpp << EOF
+int main() {
+        void *p;
+        int v = (int)p;
+        return 0;
+}
+EOF
+        $CXX $CXXFLAGS -c -o $TMPO.o tmp_pointer_is_32bit.cpp 2>/dev/null
+        status=$?
+        cc_check_clean tmp_pointer_is_32bit.cpp
+        return $status
+}
+
+echo_n "Checking 64-bitness... "
+pointer_is_32bit
+if test $? -eq 0; then
+        type_ptr=int32
+        echo "no"
+        add_line_to_config_h "/* #define SCUMM_64BITS */"
+else
+        type_ptr=int64
+        echo "yes"
+        add_line_to_config_h "#define SCUMM_64BITS"
+fi
+
+#
 # Determine data type sizes
 #
 echo_n "Type with 1 byte... "
@@ -1726,6 +1755,17 @@ TMPR="$?"
 echo "$type_4_byte"
 test $TMPR -eq 0 || exit 1	# check exit code of subshell
 
+echo_n "Type with 8 bytes... "
+type_8_byte=`find_type_with_size 8`
+TMPR="$?"
+echo "$type_8_byte"
+if test $TMPR -eq 0; then
+        _def_64bit_type_signed="typedef signed $type_8_byte int64;"
+        _def_64bit_type_unsigned="typedef unsigned $type_8_byte uint64;"
+fi
+# force cleanup after check for 8 bytes type
+cc_check_clean tmp_find_type_with_size.cpp
+
 #
 # Check whether memory alignment is required
 #
@@ -3853,6 +3893,17 @@ typedef signed $type_1_byte int8;
 typedef signed $type_2_byte int16;
 typedef signed $type_4_byte int32;
 
+/* 64-bit stuff */
+$_def_64bit_type_signed
+#if defined(__APPLE__) && !defined(__ppc__)
+#ifndef _UINT64
+#define _UINT64
+$_def_64bit_type_unsigned
+#endif
+#else
+$_def_64bit_type_unsigned
+#endif
+
 #endif /* CONFIG_H */
 EOF
 






More information about the Scummvm-git-logs mailing list