From 25cdc3736edd5283514e4de5083a0612040fc13f Mon Sep 17 00:00:00 2001 From: fleandro <3987005+flga@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:50:52 +0000 Subject: [PATCH] vendor:x11/xlib add IS_SUPPORTED constant to match core:time and friends --- vendor/vulkan/_gen/create_vulkan_odin_wrapper.py | 3 +-- vendor/vulkan/structs.odin | 3 +-- vendor/x11/xlib/xlib.odin | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 vendor/x11/xlib/xlib.odin diff --git a/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py b/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py index b8d7b9464..407e6371c 100644 --- a/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py +++ b/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py @@ -929,8 +929,7 @@ when ODIN_OS == .Windows { \t} } -// We want to use `vendor:x11/xlib` types so we need to match their build constraints. -when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .OpenBSD { +when xlib.IS_SUPPORTED { \tXlibDisplay :: xlib.Display \tXlibWindow :: xlib.Window \tXlibVisualID :: xlib.VisualID diff --git a/vendor/vulkan/structs.odin b/vendor/vulkan/structs.odin index 3bab29f4e..611a99ed7 100644 --- a/vendor/vulkan/structs.odin +++ b/vendor/vulkan/structs.odin @@ -36,8 +36,7 @@ when ODIN_OS == .Windows { } } -// We want to use `vendor:x11/xlib` types so we need to match their build constraints. -when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .OpenBSD { +when xlib.IS_SUPPORTED { XlibDisplay :: xlib.Display XlibWindow :: xlib.Window XlibVisualID :: xlib.VisualID diff --git a/vendor/x11/xlib/xlib.odin b/vendor/x11/xlib/xlib.odin new file mode 100644 index 000000000..bd9ba3b59 --- /dev/null +++ b/vendor/x11/xlib/xlib.odin @@ -0,0 +1,4 @@ +package xlib + +// Value, specifying whether `vendor:x11/xlib` is available on the current platform. +IS_SUPPORTED :: ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .OpenBSD