forked from Lainports/freebsd-ports
Changes: https://github.com/KhronosGroup/Vulkan-Headers/compare/sdk-1.2.154.0...v1.2.162 Changes: https://github.com/KhronosGroup/Vulkan-Loader/compare/sdk-1.2.154.1...v1.2.162 Changes: https://github.com/KhronosGroup/Vulkan-Tools/compare/sdk-1.2.154.0...v1.2.162 Changes: https://github.com/KhronosGroup/Vulkan-ValidationLayers/compare/sdk-1.2.154.0...v1.2.162 Changes: https://github.com/KhronosGroup/SPIRV-Tools/compare/v2020.4...v2020.6 PR: 251698 Approved by: Greg V <greg@unrelenting.technology> (maintainer)
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
--- loader/vk_loader_platform.h.orig 2020-11-23 16:19:03 UTC
|
|
+++ loader/vk_loader_platform.h
|
|
@@ -35,7 +35,7 @@
|
|
#include "vulkan/vk_platform.h"
|
|
#include "vulkan/vk_sdk_platform.h"
|
|
|
|
-#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__)
|
|
+#if defined(__unix__) || defined(__APPLE__) || defined(__Fuchsia__)
|
|
/* Linux-specific common code: */
|
|
|
|
// Headers:
|
|
@@ -120,6 +120,26 @@ static inline char *loader_platform_executable_path(ch
|
|
int ret = proc_pidpath(pid, buffer, size);
|
|
if (ret <= 0) return NULL;
|
|
buffer[ret] = '\0';
|
|
+ return buffer;
|
|
+}
|
|
+#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
|
+#include <sys/sysctl.h>
|
|
+static inline char *loader_platform_executable_path(char *buffer, size_t size) {
|
|
+ int mib[] = {
|
|
+ CTL_KERN,
|
|
+#if defined(__NetBSD__)
|
|
+ KERN_PROC_ARGS,
|
|
+ -1,
|
|
+ KERN_PROC_PATHNAME,
|
|
+#else
|
|
+ KERN_PROC,
|
|
+ KERN_PROC_PATHNAME,
|
|
+ -1,
|
|
+#endif
|
|
+ };
|
|
+ if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buffer, &size, NULL, 0) < 0)
|
|
+ return NULL;
|
|
+
|
|
return buffer;
|
|
}
|
|
#elif defined(__Fuchsia__)
|