forked from pool/virtualbox
7f251d0e0d
- Fix builds for Kernel 5.16. File "fixes_for-5.16.patch" is added. Reorder some of the patch numbers. OBS-URL: https://build.opensuse.org/request/show/932012 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=622
81 lines
2.7 KiB
Diff
81 lines
2.7 KiB
Diff
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 <stddef.h>
|
|
+#else
|
|
+# include <linux/stddef.h>
|
|
+#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 <stddef.h>
|
|
+#else
|
|
+# include <linux/stddef.h>
|
|
+#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 <linux/version.h>
|
|
# 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 <stddef.h>
|
|
+#else
|
|
+# include <linux/stddef.h>
|
|
+#endif
|
|
# include <sys/types.h>
|
|
# 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 <iprt/types.h>
|
|
+#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 <linux/version.h>
|
|
+#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 <generated/autoconf.h>
|
|
# else
|