$OpenBSD: patch-vulkaninfo_vulkaninfo_h,v 1.4 2021/12/09 04:48:32 thfr Exp $

Index: vulkaninfo/vulkaninfo.h
--- vulkaninfo/vulkaninfo.h.orig
+++ vulkaninfo/vulkaninfo.h
@@ -66,7 +66,7 @@
 #endif
 #endif  // _WIN32
 
-#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <dlfcn.h>
 #endif
 
@@ -262,7 +262,7 @@ auto GetVector(const char *func_name, F &&f, Ts &&... 
 // ----------- Instance Setup ------- //
 struct VkDll {
     VkResult Initialize() {
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
         library = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
         if (!library) library = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
 #elif defined(_WIN32)
@@ -274,7 +274,7 @@ struct VkDll {
         return VK_SUCCESS;
     }
     void Close() {
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
         dlclose(library);
 #elif defined(_WIN32)
         FreeLibrary(library);
@@ -429,13 +429,13 @@ struct VkDll {
   private:
     template <typename T>
     void Load(T &func_dest, const char *func_name) {
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
         func_dest = reinterpret_cast<T>(dlsym(library, func_name));
 #elif defined(_WIN32)
         func_dest = reinterpret_cast<T>(GetProcAddress(library, func_name));
 #endif
     }
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
     void *library;
 #elif defined(_WIN32)
     HMODULE library;
@@ -1765,4 +1765,4 @@ std::unordered_map<PropFlags, std::vector<VkFormat>> F
         }
     }
     return map;
-}
\ No newline at end of file
+}
