summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2023-09-07 21:54:22 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2023-09-07 21:54:22 +0000
commiteb63c9dae774a6f7f0fd1534035b61b9a54a594e (patch)
treef9ec16289f1cc1e58b392a84db1eb0d55d99ce7a /proto
parent4bc177c6584e9c7b6139899f6526557f584aa0f4 (diff)
Fix the build after recent CARD64 / unsigned long fises for llvm 16
There are many places in X drivers where CARD64 is used mixed with uint64_t and CARD32 mixed with uint32_t. Initially the CARD* types were only meant to be used in the X protocol definition and implementation. Later they got used in driver for fixed- length unsigned integers as synonyms for uintxx_t types. Unfortunatly on OpenBSD the definition of uint64_t and CARD64 don't match. So take the bull by the horns and fix the CARDxx definitions using the corresponding uintxx_t types from stdint.h.
Diffstat (limited to 'proto')
-rw-r--r--proto/xorgproto/include/X11/Xmd.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/proto/xorgproto/include/X11/Xmd.h b/proto/xorgproto/include/X11/Xmd.h
index 68c45dbec..c84ea66f5 100644
--- a/proto/xorgproto/include/X11/Xmd.h
+++ b/proto/xorgproto/include/X11/Xmd.h
@@ -57,6 +57,8 @@ SOFTWARE.
# include <sys/isa_defs.h> /* Solaris: defines _LP64 if necessary */
# endif
+#include <stdint.h>
+
#if defined(__SIZEOF_LONG__)
# if __SIZEOF_LONG__ == 8
# define LONG64 /* 32/64-bit architecture */
@@ -107,15 +109,10 @@ typedef short INT16;
typedef signed char INT8;
-# ifdef LONG64
-typedef unsigned long CARD64;
-typedef unsigned int CARD32;
-# else
-typedef unsigned long long CARD64;
-typedef unsigned long CARD32;
-# endif
-typedef unsigned short CARD16;
-typedef unsigned char CARD8;
+typedef uint64_t CARD64;
+typedef uint32_t CARD32;
+typedef uint16_t CARD16;
+typedef uint8_t CARD8;
typedef CARD32 BITS32;
typedef CARD16 BITS16;