aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2022-08-30 19:13:27 -0400
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-08-31 10:02:07 -0600
commit77cf67df0795d0bceb51fe6737b4c9aed6694572 (patch)
tree04f83d77e18138d18e7dacc8570bbf8f69c2b911
parent439026106ac98679e5961a499790327a8bf8f1d6 (diff)
downloadusermoji-77cf67df0795d0bceb51fe6737b4c9aed6694572.tar.xz
vulkaninfo/cube: added support for OpenBSD
-rw-r--r--cube/cube.cpp2
-rw-r--r--cube/gettime.h2
-rw-r--r--vulkaninfo/vulkaninfo.h10
3 files changed, 7 insertions, 7 deletions
diff --git a/cube/cube.cpp b/cube/cube.cpp
index 910b1be1..aa3d7b20 100644
--- a/cube/cube.cpp
+++ b/cube/cube.cpp
@@ -3150,7 +3150,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine,
return static_cast<int>(msg.wParam);
}
-#elif defined(__linux__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int main(int argc, char **argv) {
Demo demo;
diff --git a/cube/gettime.h b/cube/gettime.h
index 4be0d851..5eae98fd 100644
--- a/cube/gettime.h
+++ b/cube/gettime.h
@@ -26,7 +26,7 @@
#include <windows.h>
-#elif defined(__unix__) || defined(__linux) || defined(__linux__) || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__EPOC32__) || defined(__QNX__)
+#elif defined(__unix__) || defined(__linux) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__ANDROID__) || defined(__EPOC32__) || defined(__QNX__)
#include <time.h>
diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h
index 543257cd..1e8be531 100644
--- a/vulkaninfo/vulkaninfo.h
+++ b/vulkaninfo/vulkaninfo.h
@@ -67,7 +67,7 @@
#endif
#endif // _WIN32
-#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <dlfcn.h>
#endif
@@ -252,7 +252,7 @@ auto GetVector(const char *func_name, F &&f, Ts &&...ts) -> std::vector<T> {
// ----------- 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)
@@ -264,7 +264,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);
@@ -425,13 +425,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;