From a36f8ad162f8ee75fd72eadb7147960ed4a04680 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 28 Jul 2024 23:14:45 -0400 Subject: [PATCH] build: detect VT_GETMODE on OpenBSD --- meson.build | 4 +++- video/out/drm_common.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b66efb08db..25cf832c6a 100644 --- a/meson.build +++ b/meson.build @@ -539,6 +539,8 @@ features += {'vt.h': cc.has_header_symbol('sys/vt.h', 'VT_GETMODE')} features += {'consio.h': not features['vt.h'] and cc.has_header_symbol('sys/consio.h', 'VT_GETMODE')} +features += {'wsdisplay-usl-io.h': cc.has_header_symbol('dev/wscons/wsdisplay_usl_io.h', 'VT_GETMODE', prefix: '#include ')} + # macOS's pthread_setname_np is a special snowflake and differs from literally every other platform. features += {'mac-thread-name': darwin} @@ -926,7 +928,7 @@ if features['direct3d'] endif drm = dependency('libdrm', version: '>= 2.4.105', required: get_option('drm')) -features += {'drm': drm.found() and (features['vt.h'] or features['consio.h'])} +features += {'drm': drm.found() and (features['vt.h'] or features['consio.h'] or features['wsdisplay-usl-io.h'])} if features['drm'] dependencies += drm sources += files('video/drmprime.c', diff --git a/video/out/drm_common.c b/video/out/drm_common.c index 0f6b5595ec..5961df52f2 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -31,8 +31,10 @@ #if HAVE_CONSIO_H #include -#else +#elif HAVE_VT_H #include +#elif HAVE_WSDISPLAY_USL_IO_H +#include #endif #include "drm_atomic.h"