Index: VirtualBox-6.1.28/include/iprt/types.h =================================================================== --- VirtualBox-6.1.28.orig/include/iprt/types.h +++ VirtualBox-6.1.28/include/iprt/types.h @@ -90,8 +90,13 @@ RT_C_DECLS_END * though they need to be long long unsigned and long long int). These * defines conflict with our declaration in stdint.h. Adding the defines * below omits the definitions in the system header. + * */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) # include +#else +# include +#endif # define _UINT64_T_DECLARED # define _INT64_T_DECLARED # define _UINTPTR_T_DECLARED @@ -131,13 +136,19 @@ RT_C_DECLS_END * 3. Starting with 2.6.24, linux/types.h typedefs uintptr_t. * We work around these issues here and nowhere else. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) # include +#else +# include +#endif # if defined(__cplusplus) typedef bool _Bool; # endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) # define bool linux_bool # define true linux_true # define false linux_false +#endif # define uintptr_t linux_uintptr_t # include # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) @@ -185,7 +196,11 @@ RT_C_DECLS_END # undef true # undef bool # else +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) # include +#else +# include +#endif # include # endif Index: VirtualBox-6.1.28/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h =================================================================== --- VirtualBox-6.1.28.orig/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h +++ VirtualBox-6.1.28/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h @@ -35,7 +35,9 @@ * Then use the linux bool type for all the stuff include here. */ #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) #define bool linux_bool +#endif #if RT_GNUC_PREREQ(4, 6) # pragma GCC diagnostic push Index: VirtualBox-6.1.28/src/VBox/Runtime/include/internal/iprt.h =================================================================== --- VirtualBox-6.1.28.orig/src/VBox/Runtime/include/internal/iprt.h +++ VirtualBox-6.1.28/src/VBox/Runtime/include/internal/iprt.h @@ -41,8 +41,10 @@ && defined(IN_RING0) \ && defined(MODULE) \ && !defined(RT_NO_EXPORT_SYMBOL) -# define bool linux_bool /* see r0drv/linux/the-linux-kernel.h */ # include +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +# define bool linux_bool /* see r0drv/linux/the-linux-kernel.h */ +#endif # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) # include # else