vendor:x11/xlib add IS_SUPPORTED constant to match core:time and friends

This commit is contained in:
fleandro
2025-01-05 17:50:52 +00:00
parent 98967aad74
commit 25cdc3736e
3 changed files with 6 additions and 4 deletions

View File

@@ -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

View File

@@ -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

4
vendor/x11/xlib/xlib.odin vendored Normal file
View File

@@ -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