libx86-1: Fix build on 32bit x86

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2023-03-05 14:30:50 -08:00
parent 0b3e6c1973
commit d61066d08d

View File

@ -3,7 +3,8 @@ From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 2 Mar 2023 18:47:40 -0800
Subject: [PATCH] Define CARD32 as uint as it is 32-bit
long can be 64bit on LP64 systems
long can be 64bit on LP64 systems and none of systems we support need int < 32-bits
therefore use NUM32 to be int always if the system is linux
Fixes build with clang-16
thunk.c:147:3: error: incompatible function pointer types initializing 'x86emuu32 (*)(X86EMU_pioAddr)' (aka 'unsigned int (*)(unsigned short)') with an expression of type 'unsigned long (*)(unsigned short)' [-Wincompatible-function-pointer-types]
@ -16,8 +17,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
x86emu/include/xf86int10.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86emu/include/xf86int10.h b/x86emu/include/xf86int10.h
index 9c131dd..acd5114 100644
--- a/x86emu/include/xf86int10.h
+++ b/x86emu/include/xf86int10.h
@@ -18,7 +18,7 @@
@ -29,6 +28,15 @@ index 9c131dd..acd5114 100644
#define pointer void *
#define IOADDRESS void *
#define Bool int
--
2.39.2
--- a/x86emu/include/types.h
+++ b/x86emu/include/types.h
@@ -77,7 +77,8 @@
defined(__s390x__) || \
(defined(__hppa__) && defined(__LP64)) || \
defined(__amd64__) || defined(amd64) || \
- (defined(__sgi) && (_MIPS_SZLONG == 64))
+ (defined(__sgi) && (_MIPS_SZLONG == 64)) || \
+ defined(__linux__)
#define NUM32 int
#else
#define NUM32 long