Blob Blame Raw
From b533d722fa62232955aedfdf1bbc0179f48497eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Thu, 1 Mar 2018 19:41:10 +0100
Subject: [PATCH] Support for BIND 9.11.3. Include explicitly isc/util.h in
 each file that uses REQUIRE(). Support stdatomic feature, do not use function
 call in STATIC_ASSERT().

---
 src/bindcfg.c      |  1 +
 src/fwd_register.c |  1 +
 src/ldap_entry.h   | 11 +++++------
 src/mldap.c        |  4 ++--
 src/rbt_helper.c   |  1 +
 src/types.h        |  2 +-
 6 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/bindcfg.c b/src/bindcfg.c
index 9b429ba..5539dea 100644
--- a/src/bindcfg.c
+++ b/src/bindcfg.c
@@ -6,6 +6,7 @@
 
 #include "config.h"
 
+#include <isc/util.h>
 #include <isccfg/grammar.h>
 #include <isccfg/namedconf.h>
 
diff --git a/src/fwd_register.c b/src/fwd_register.c
index 355d15f..7cc0c5a 100644
--- a/src/fwd_register.c
+++ b/src/fwd_register.c
@@ -3,6 +3,7 @@
  */
 
 #include <isc/rwlock.h>
+#include <isc/util.h>
 #include <dns/name.h>
 
 #include "rbt_helper.h"
diff --git a/src/ldap_entry.h b/src/ldap_entry.h
index 6498c79..88b1c42 100644
--- a/src/ldap_entry.h
+++ b/src/ldap_entry.h
@@ -6,7 +6,6 @@
 #define _LD_LDAP_ENTRY_H_
 
 #include <isc/lex.h>
-#include <isc/util.h>
 #include <dns/types.h>
 
 #include "fwd_register.h"
@@ -19,15 +18,15 @@
 
 /* Represents values associated with LDAP attribute */
 typedef struct ldap_value ldap_value_t;
-typedef LIST(ldap_value_t) ldap_valuelist_t;
+typedef ISC_LIST(ldap_value_t) ldap_valuelist_t;
 struct ldap_value {
         char                    *value;
-        LINK(ldap_value_t)      link;
+        ISC_LINK(ldap_value_t)      link;
 };
 
 /* Represents LDAP attribute and it's values */
 typedef struct ldap_attribute	ldap_attribute_t;
-typedef LIST(ldap_attribute_t)	ldap_attributelist_t;
+typedef ISC_LIST(ldap_attribute_t)	ldap_attributelist_t;
 
 /* Represents LDAP entry and it's attributes */
 typedef unsigned char		ldap_entryclass_t;
@@ -41,7 +40,7 @@ struct ldap_entry {
 
 	ldap_attribute_t	*lastattr;
 	ldap_attributelist_t	attrs;
-	LINK(ldap_entry_t)	link;
+	ISC_LINK(ldap_entry_t)	link;
 
 	/* Parsing. */
 	isc_lex_t		*lex;
@@ -59,7 +58,7 @@ struct ldap_attribute {
 	char			**ldap_values;
 	ldap_value_t		*lastval;
 	ldap_valuelist_t	values;
-	LINK(ldap_attribute_t)	link;
+	ISC_LINK(ldap_attribute_t)	link;
 };
 
 #define LDAP_ENTRYCLASS_NONE	0x0
diff --git a/src/mldap.c b/src/mldap.c
index 143abce..304ba36 100644
--- a/src/mldap.c
+++ b/src/mldap.c
@@ -119,13 +119,13 @@ void mldap_cur_generation_bump(mldapdb_t *mldap) {
  * reference counter value.
  */
 STATIC_ASSERT((isc_uint32_t)
-		(typeof(isc_refcount_current((isc_refcount_t *)0)))
+		(typeof(((isc_refcount_t *)0)->refs))
 		-1
 	      == 0xFFFFFFFF, \
 	      "negative isc_refcount_t cannot be properly shortened to 32 bits");
 
 STATIC_ASSERT((isc_uint32_t)
-		(typeof(isc_refcount_current((isc_refcount_t *)0)))
+		(typeof(((isc_refcount_t *)0)->refs))
 		0x90ABCDEF12345678
 	      == 0x12345678, \
 	      "positive isc_refcount_t cannot be properly shortened to 32 bits");
diff --git a/src/rbt_helper.c b/src/rbt_helper.c
index 2a7e6cb..f610b07 100644
--- a/src/rbt_helper.c
+++ b/src/rbt_helper.c
@@ -2,6 +2,7 @@
  * Copyright (C) 2013-2014  bind-dyndb-ldap authors; see COPYING for license
  */
 
+#include <isc/util.h>
 #include <dns/rbt.h>
 
 #include "util.h"
diff --git a/src/types.h b/src/types.h
index 25ef3b9..01d627c 100644
--- a/src/types.h
+++ b/src/types.h
@@ -24,7 +24,7 @@
  * rdata1 -> rdata2 -> rdata3           rdata4 -> rdata5
  * next_rdatalist              ->       next_rdatalist  ...
  */
-typedef LIST(dns_rdatalist_t) ldapdb_rdatalist_t;
+typedef ISC_LIST(dns_rdatalist_t) ldapdb_rdatalist_t;
 
 typedef struct enum_txt_assoc {
 	int		value;
-- 
2.14.3