From 679865993a42ff96d3984b8373293876802a2dcb Mon Sep 17 00:00:00 2001
From: "Z. Liu" <zhixu.liu@gmail.com>
Date: Thu, 3 Dec 2026 17:21:36 +0800
Subject: [PATCH] ldapc++: add check for sys/time.h

which is required on musl. No issue on glibc, where it is provided
through transitive header dependencies.

Fix the following error:

> LDAPConstraints.cpp:162:28: error: invalid use of incomplete type 'struct timeval'
>   162 |         timeval *ret = new timeval;
>       |                            ^~~~~~~

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>

diff --git a/contrib/ldapc++/configure b/contrib/ldapc++/configure
index c02a6c6dd8..bb9fc1c801 100755
--- a/contrib/ldapc++/configure
+++ b/contrib/ldapc++/configure
@@ -16008,7 +16008,7 @@ else
 
 fi
 
-for ac_header in termios.h ldap.h
+for ac_header in termios.h ldap.h sys/time.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/contrib/ldapc++/src/config.h.in b/contrib/ldapc++/src/config.h.in
index feec4896f6..9adbc5b83b 100644
--- a/contrib/ldapc++/src/config.h.in
+++ b/contrib/ldapc++/src/config.h.in
@@ -30,6 +30,9 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-- 
2.49.1

