Vulkan-Loader-pr475.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From e1c938170bba5879d95bf2d7b57b4d1d68557cd5 Mon Sep 17 00:00:00 2001
  2. From: Brecht Sanders <[email protected]>
  3. Date: Tue, 29 Sep 2020 18:14:55 +0200
  4. Subject: [PATCH] loader: Fixes build with MinGW-w64 8.0.0.
  5. See http://winlibs.com for a release of such GCC compiler
  6. See issue https://github.com/KhronosGroup/Vulkan-Loader/issues/474
  7. ---
  8. loader/loader.c | 7 +++++++
  9. 1 file changed, 7 insertions(+), 0 deletions(-)
  10. diff --git a/loader/loader.c b/loader/loader.c
  11. index 4d8865e13..509f2f420 100644
  12. --- a/loader/loader.c
  13. +++ b/loader/loader.c
  14. @@ -71,6 +71,9 @@
  15. #include <devpkey.h>
  16. #include <winternl.h>
  17. #include <strsafe.h>
  18. +#ifdef __MINGW32__
  19. +#undef strcpy // fix error with redfined strcpy when building with MinGW-w64
  20. +#endif
  21. #include <dxgi1_6.h>
  22. #include "adapters.h"
  23. @@ -695,7 +698,11 @@ VkResult loaderGetDeviceRegistryFiles(const struct loader_instance *inst, char *
  24. LPCSTR value_name) {
  25. static const wchar_t *softwareComponentGUID = L"{5c4c3332-344d-483c-8739-259e934c9cc8}";
  26. static const wchar_t *displayGUID = L"{4d36e968-e325-11ce-bfc1-08002be10318}";
  27. +#ifdef CM_GETIDLIST_FILTER_PRESENT
  28. const ULONG flags = CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT;
  29. +#else
  30. + const ULONG flags = 0x300;
  31. +#endif
  32. wchar_t childGuid[MAX_GUID_STRING_LEN + 2]; // +2 for brackets {}
  33. ULONG childGuidSize = sizeof(childGuid);