From 4388cb77794c94c329bfe2ac977a59f71b72f6d0 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: Thu, 7 Nov 2024 15:48:31 +0300
Subject: [PATCH v3 1/3] Fix meson could not find bsd_auth.h

bsd_auth.h file needs to be compiled together with the 'sys/types.h' as
it has missing type definitions.

See synopsis at https://man.openbsd.org/authenticate.3
---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index cfd654d2916..50731f47f7e 100644
--- a/meson.build
+++ b/meson.build
@@ -557,7 +557,8 @@ test_c_args = cppflags + cflags
 bsd_authopt = get_option('bsd_auth')
 bsd_auth = not_found_dep
 if cc.check_header('bsd_auth.h', required: bsd_authopt,
-    args: test_c_args, include_directories: postgres_inc)
+    args: test_c_args, prefix: '#include <sys/types.h>',
+    include_directories: postgres_inc)
   cdata.set('USE_BSD_AUTH', 1)
   bsd_auth = declare_dependency()
 endif
-- 
2.47.1

