From 94945a52746ee2612c6cd394692f49e2ed5fc56b Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 2 Aug 2023 12:33:19 +0100 Subject: [PATCH] Switch to libbsd-overlay This is more portable than libbsd as everything Just Works, even on BSD systems, and is the recommended method of consuming libbsd nowadays. It also helpfully lets things work with glibc-provided functions for new enough glibc. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/973 Co-authored-by: Guillem Jover Signed-off-by: Sam James --- include/os.h | 9 +++------ meson.build | 2 +- os/auth.c | 4 +--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/os.h b/include/os.h index bb3348b18..7db24088f 100644 --- a/include/os.h +++ b/include/os.h @@ -50,16 +50,13 @@ SOFTWARE. #include "misc.h" #include #include +#if defined(HAVE_REALLOCARRAY) +#include /* for reallocarray */ +#endif #include #ifdef MONOTONIC_CLOCK #include #endif -#if defined(HAVE_LIBBSD) && defined(HAVE_REALLOCARRAY) -#include /* for reallocarray */ -#endif -#if defined(HAVE_LIBBSD) && defined(HAVE_STRLCPY) -#include /* for strlcpy, strlcat */ -#endif #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 diff --git a/meson.build b/meson.build index 515cc44ea..0279ea211 100644 --- a/meson.build +++ b/meson.build @@ -98,7 +98,7 @@ xshmfence_dep = dependency('xshmfence', version: '>= 1.1', required: false) xwaylandproto_dep = dependency('xwaylandproto', version: '>= 1.0', fallback: ['xorgproto', 'ext_xorgproto'], required: false) pixman_dep = dependency('pixman-1') -libbsd_dep = dependency('libbsd', required: false) +libbsd_dep = dependency('libbsd-overlay', required: false) xkbcomp_dep = dependency('xkbcomp', required: false) xkbfile_dep = dependency('xkbfile') xfont2_dep = dependency('xfont2', version: '>= 2.0') diff --git a/os/auth.c b/os/auth.c index 611e4efb1..243d3c5a8 100644 --- a/os/auth.c +++ b/os/auth.c @@ -46,9 +46,7 @@ from The Open Group. #ifdef WIN32 #include #endif -#ifdef HAVE_LIBBSD -#include /* for arc4random_buf() */ -#endif +#include /* for arc4random_buf() */ struct protocol { unsigned short name_length;