[PATCH 1/4] winevulkan: Define alloca and forceinline

Joshua Ashton joshua at froggi.es
Thu Mar 5 11:03:00 CST 2020


Sets up these definitions needed for future patches

Signed-off-by: Joshua Ashton <joshua at froggi.es>
---
 dlls/winevulkan/vulkan_private.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h
index 17072d2341..88233daced 100644
--- a/dlls/winevulkan/vulkan_private.h
+++ b/dlls/winevulkan/vulkan_private.h
@@ -34,6 +34,18 @@
 
 #include "vulkan_thunks.h"
 
+#if defined(__GNUC__) || defined(__clang__)
+#include <alloca.h>
+#define WINEVULKAN_FORCEINLINE __attribute__((always_inline)) inline
+#define WINEVULKAN_ALLOCA(x)   alloca(x)
+#elif defined(_MSC_VER)
+#include <malloc.h>
+#define WINEVULKAN_FORCEINLINE __forceinline
+#define WINEVULKAN_ALLOCA(x)   _alloca(x)
+#else
+#error Unsupported platform for forceinline/alloca
+#endif
+
 /* Magic value defined by Vulkan ICD / Loader spec */
 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
 
-- 
2.25.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winevulkan-Define-alloca-and-forceinline.patch
Type: application/octet-stream
Size: 1144 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200305/548585e6/attachment.obj>


More information about the wine-devel mailing list