aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-Define-CARD32-as-uint-as-it-is-32-bit.patch
blob: aef521bc5de5c36b499e7709bf2c8651d5b6d5ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 592c915df252932961a4151c891da58c48a8db90 Mon Sep 17 00:00:00 2001
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 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]
                (&x_inl),
                ^~~~~~~~

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 x86emu/include/xf86int10.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/x86emu/include/xf86int10.h
+++ b/x86emu/include/xf86int10.h
@@ -18,7 +18,7 @@
 
 #define CARD8  unsigned char
 #define CARD16 unsigned short
-#define CARD32 unsigned long
+#define CARD32 unsigned int
 #define pointer void *
 #define IOADDRESS void *
 #define Bool int
--- 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