On Linux/m68k platforms, I get this compilation error:
In file included from ../../gltests/jit/test-cache.c:20:
../../gltests/../gllib/jit/cache.h: In function ‘clear_cache’:
../../gltests/../gllib/jit/cache.h:106:12: error: unknown type name ‘uintptr_t’
106 | register uintptr_t addr __asm__ ("%d1") = (uintptr_t) start;
| ^~~~~~~~~
On Linux/sparc64, similarly:
In file included from ../../gltests/jit/test-cache.c:20:
../../gltests/../gllib/jit/cache.h: In function ‘clear_cache’:
../../gltests/../gllib/jit/cache.h:93:3: error: unknown type name ‘uintptr_t’
93 | uintptr_t addr = (uintptr_t) start & ~(intptr_t)7;
| ^~~~~~~~~
This patch fixes it.
2023-12-19 Bruno Haible <[email protected]>
jit/cache: Fix compilation error on m68k, sparc, etc.
* lib/jit/cache.h: Include <stdint.h>.
* modules/jit/cache (Depends-on): Add stdint.
diff --git a/lib/jit/cache.h b/lib/jit/cache.h
index ce470399e5..a6653fdc4e 100644
--- a/lib/jit/cache.h
+++ b/lib/jit/cache.h
@@ -17,6 +17,7 @@
/* Written by Bruno Haible <[email protected]>, 2020. */
+#include <stdint.h>
#if ENABLE_VALGRIND_SUPPORT
# include <valgrind/valgrind.h>
#endif
diff --git a/modules/jit/cache b/modules/jit/cache
index f7af2be314..e836bddcf1 100644
--- a/modules/jit/cache
+++ b/modules/jit/cache
@@ -6,6 +6,7 @@ lib/jit/cache.h
m4/valgrind-helper.m4
Depends-on:
+stdint
configure.ac:
gl_VALGRIND_HELPER