]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_ad_group_acl: fix dependency detection (#1882)
authorAmos Jeffries <yadij@users.noreply.github.com>
Tue, 13 Aug 2024 13:52:39 +0000 (13:52 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 14 Aug 2024 06:44:59 +0000 (06:44 +0000)
.. and compliance with Squid coding style.

src/acl/external/AD_group/ext_ad_group_acl.cc
src/acl/external/AD_group/required.m4

index ce9c62b391676951ddb93f23ae339a974ecdaf0c..3d671445319ce5395bf5fb9aaa3e7b04615e00b2 100644 (file)
@@ -78,19 +78,37 @@ int _wcsicmp(const wchar_t *, const wchar_t *);
 #include <cassert>
 #include <cctype>
 #include <cstring>
+
 #if HAVE_GETOPT_H
 #include <getopt.h>
 #endif
-#include <windows.h>
+#if HAVE_OBJBASE_H
 #include <objbase.h>
+#endif
+#if HAVE_INITGUID_H
 #include <initguid.h>
+#endif
+#if HAVE_ADSIID_H
 #include <adsiid.h>
+#endif
+#if HAVE_IADS_H
 #include <iads.h>
+#endif
+#if HAVE_ADSHLP_H
 #include <adshlp.h>
+#endif
+#if HAVE_ADSERR_H
 #include <adserr.h>
+#endif
+#if HAVE_LM_H
 #include <lm.h>
+#endif
+#if HAVE_DSROLE_H
 #include <dsrole.h>
+#endif
+#if HAVE_SDDL_H
 #include <sddl.h>
+#endif
 
 enum ADSI_PATH {
     LDAP_MODE,
index ca804940544847a2cc0dcf18d10b5b8a2bdaeab9..319060c05682a1c6692e3cdb9dfc42d2ca958c80 100755 (executable)
@@ -5,11 +5,41 @@
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
-for hdr in w32api/dsrole.h dsrole.h; do
+AC_CHECK_HEADERS([dsrole.h],[
+  # required API feature
   AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([[#include <$hdr>]], [[
+    AC_LANG_PROGRAM([[
+#     if HAVE_WINDOWS_H
+#     include <windows.h>
+#     endif
+#     if HAVE_DSROLE_H
+#     include <dsrole.h>
+#     endif
+  ]], [[
       PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo;
       DWORD ret = DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo);
     ]])
-  ],[BUILD_HELPER="AD_group"],[])
-done
+  ],[BUILD_HELPER="AD_group"],[:])
+  # required headers
+  AC_CHECK_HEADERS([ \
+    objbase.h \
+    initguid.h \
+    adsiid.h \
+    iads.h \
+    adshlp.h \
+    adserr.h \
+    lm.h \
+    sddl.h
+  ],[:],[BUILD_HELPER=""],[
+#   if HAVE_WINDOWS_H
+#   include <windows.h>
+#   endif
+#   if HAVE_IADS_H
+#   include <iads.h>
+#   endif
+  ])
+],,[
+#  if HAVE_WINDOWS_H
+#  include <windows.h>
+#  endif
+])