summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2023-03-09 10:46:35 +0100
committerYuri Sizov <yuris@humnom.net>2023-03-14 13:59:04 +0100
commit9e5e6568b71c6222c0739a7c3c484c3715847490 (patch)
tree56e2b3ec28fd89f09fa6036ff3dec54c0ce2238a
parent26ab941507b11de491a11a24b5a1dd72a72082f5 (diff)
Vulkan: Fix VMA build with GCC 13
Fixes #74647. (cherry picked from commit b113e6d4ff18dc1b1e6f4ec1bd0e307fd1d8623d)
-rw-r--r--thirdparty/vulkan/patches/VMA-fix-gcc13.patch26
-rw-r--r--thirdparty/vulkan/vk_mem_alloc.h4
2 files changed, 30 insertions, 0 deletions
diff --git a/thirdparty/vulkan/patches/VMA-fix-gcc13.patch b/thirdparty/vulkan/patches/VMA-fix-gcc13.patch
new file mode 100644
index 0000000000..08928503a7
--- /dev/null
+++ b/thirdparty/vulkan/patches/VMA-fix-gcc13.patch
@@ -0,0 +1,26 @@
+From 29d492b60c84ca784ea0943efc7d2e6e0f3bdaac Mon Sep 17 00:00:00 2001
+From: Adam Sawicki <adam.sawicki@amd.com>
+Date: Thu, 19 Jan 2023 13:19:55 +0100
+Subject: [PATCH] Added missing #include <cstdio>
+
+For snprintf, for compatibility with GCC 13.
+Fixes #312 - thanks @marxin !
+---
+ thirdparty/vulkan/vk_mem_alloc.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h
+index b787c36..0fe459b 100644
+--- a/thirdparty/vulkan/vk_mem_alloc.h
++++ b/thirdparty/vulkan/vk_mem_alloc.h
+@@ -2614,6 +2614,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
+ #include <bit> // For std::popcount
+ #endif
+
++#if VMA_STATS_STRING_ENABLED
++ #include <cstdio> // For snprintf
++#endif
++
+ /*******************************************************************************
+ CONFIGURATION SECTION
+
diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h
index 184ee005d8..ea30060649 100644
--- a/thirdparty/vulkan/vk_mem_alloc.h
+++ b/thirdparty/vulkan/vk_mem_alloc.h
@@ -2582,6 +2582,10 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
#include <bit> // For std::popcount
#endif
+#if VMA_STATS_STRING_ENABLED
+ #include <cstdio> // For snprintf
+#endif
+
/*******************************************************************************
CONFIGURATION SECTION