Received: from eggs.gnu.org ([140.186.70.92]:36872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt3xu-0006U6-71 for qemu-devel@nongnu.org; Thu, 02 Feb 2012 16:13:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt3xr-0000JY-68 for qemu-devel@nongnu.org; Thu, 02 Feb 2012 16:13:10 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:40218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt3xq-0000Hn-UL for qemu-devel@nongnu.org; Thu, 02 Feb 2012 16:13:07 -0500 From: Stefan Weil Date: Thu, 2 Feb 2012 22:12:57 +0100 Message-Id: <1328217177-32745-16-git-send-email-sw@weilnetz.de> In-Reply-To: <1328217177-32745-1-git-send-email-sw@weilnetz.de> References: <1328217177-32745-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH 15/15] Move definition of HOST_LONG_BITS to qemu-common.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Weil Like the related macro TCG_TARGET_LONG, HOST_LONG_BITS can be determined by the C preprocessor. It is also not used in Makefiles. So there is no need to calculate it in configure, and it can be defined in qemu-common.h. Signed-off-by: Stefan Weil --- configure | 12 ------------ qemu-common.h | 9 +++++++++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 3b0b300..6dec57d 100755 --- a/configure +++ b/configure @@ -1266,17 +1266,6 @@ esac fi -# host long bits test, actually a pointer size test -cat > $TMPC << EOF -int sizeof_pointer_is_8[sizeof(void *) == 8 ? 1 : -1]; -EOF -if compile_object; then -hostlongbits=64 -else -hostlongbits=32 -fi - - ########################################## # NPTL probe @@ -2927,7 +2916,6 @@ fi if test "$bigendian" = "yes" ; then echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak fi -echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak if test "$mingw32" = "yes" ; then echo "CONFIG_WIN32=y" >> $config_host_mak rc_version=`cat $source_path/VERSION` diff --git a/qemu-common.h b/qemu-common.h index 8b69a9e..bd0b1bd 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -65,6 +65,15 @@ typedef struct Monitor Monitor; #define TIME_MAX LONG_MAX #endif +/* HOST_LONG_BITS is the size of a native pointer in bits. */ +#if UINTPTR_MAX == UINT32_MAX +# define HOST_LONG_BITS 32 +#elif UINTPTR_MAX == UINT64_MAX +# define HOST_LONG_BITS 64 +#else +# error Unknown pointer size +#endif + #ifndef CONFIG_IOVEC #define CONFIG_IOVEC struct iovec { -- 1.7.7.3