d9682bf
From b533d722fa62232955aedfdf1bbc0179f48497eb Mon Sep 17 00:00:00 2001
d9682bf
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
d9682bf
Date: Thu, 1 Mar 2018 19:41:10 +0100
d9682bf
Subject: [PATCH] Support for BIND 9.11.3. Include explicitly isc/util.h in
d9682bf
 each file that uses REQUIRE(). Support stdatomic feature, do not use function
d9682bf
 call in STATIC_ASSERT().
d9682bf
d9682bf
---
d9682bf
 src/bindcfg.c      |  1 +
d9682bf
 src/fwd_register.c |  1 +
d9682bf
 src/ldap_entry.h   | 11 +++++------
d9682bf
 src/mldap.c        |  4 ++--
d9682bf
 src/rbt_helper.c   |  1 +
d9682bf
 src/types.h        |  2 +-
d9682bf
 6 files changed, 11 insertions(+), 9 deletions(-)
d9682bf
d9682bf
diff --git a/src/bindcfg.c b/src/bindcfg.c
d9682bf
index 9b429ba..5539dea 100644
d9682bf
--- a/src/bindcfg.c
d9682bf
+++ b/src/bindcfg.c
d9682bf
@@ -6,6 +6,7 @@
d9682bf
 
d9682bf
 #include "config.h"
d9682bf
 
d9682bf
+#include <isc/util.h>
d9682bf
 #include <isccfg/grammar.h>
d9682bf
 #include <isccfg/namedconf.h>
d9682bf
 
d9682bf
diff --git a/src/fwd_register.c b/src/fwd_register.c
d9682bf
index 355d15f..7cc0c5a 100644
d9682bf
--- a/src/fwd_register.c
d9682bf
+++ b/src/fwd_register.c
d9682bf
@@ -3,6 +3,7 @@
d9682bf
  */
d9682bf
 
d9682bf
 #include <isc/rwlock.h>
d9682bf
+#include <isc/util.h>
d9682bf
 #include <dns/name.h>
d9682bf
 
d9682bf
 #include "rbt_helper.h"
d9682bf
diff --git a/src/ldap_entry.h b/src/ldap_entry.h
d9682bf
index 6498c79..88b1c42 100644
d9682bf
--- a/src/ldap_entry.h
d9682bf
+++ b/src/ldap_entry.h
d9682bf
@@ -6,7 +6,6 @@
d9682bf
 #define _LD_LDAP_ENTRY_H_
d9682bf
 
d9682bf
 #include <isc/lex.h>
d9682bf
-#include <isc/util.h>
d9682bf
 #include <dns/types.h>
d9682bf
 
d9682bf
 #include "fwd_register.h"
d9682bf
@@ -19,15 +18,15 @@
d9682bf
 
d9682bf
 /* Represents values associated with LDAP attribute */
d9682bf
 typedef struct ldap_value ldap_value_t;
d9682bf
-typedef LIST(ldap_value_t) ldap_valuelist_t;
d9682bf
+typedef ISC_LIST(ldap_value_t) ldap_valuelist_t;
d9682bf
 struct ldap_value {
d9682bf
         char                    *value;
d9682bf
-        LINK(ldap_value_t)      link;
d9682bf
+        ISC_LINK(ldap_value_t)      link;
d9682bf
 };
d9682bf
 
d9682bf
 /* Represents LDAP attribute and it's values */
d9682bf
 typedef struct ldap_attribute	ldap_attribute_t;
d9682bf
-typedef LIST(ldap_attribute_t)	ldap_attributelist_t;
d9682bf
+typedef ISC_LIST(ldap_attribute_t)	ldap_attributelist_t;
d9682bf
 
d9682bf
 /* Represents LDAP entry and it's attributes */
d9682bf
 typedef unsigned char		ldap_entryclass_t;
d9682bf
@@ -41,7 +40,7 @@ struct ldap_entry {
d9682bf
 
d9682bf
 	ldap_attribute_t	*lastattr;
d9682bf
 	ldap_attributelist_t	attrs;
d9682bf
-	LINK(ldap_entry_t)	link;
d9682bf
+	ISC_LINK(ldap_entry_t)	link;
d9682bf
 
d9682bf
 	/* Parsing. */
d9682bf
 	isc_lex_t		*lex;
d9682bf
@@ -59,7 +58,7 @@ struct ldap_attribute {
d9682bf
 	char			**ldap_values;
d9682bf
 	ldap_value_t		*lastval;
d9682bf
 	ldap_valuelist_t	values;
d9682bf
-	LINK(ldap_attribute_t)	link;
d9682bf
+	ISC_LINK(ldap_attribute_t)	link;
d9682bf
 };
d9682bf
 
d9682bf
 #define LDAP_ENTRYCLASS_NONE	0x0
d9682bf
diff --git a/src/mldap.c b/src/mldap.c
d9682bf
index 143abce..304ba36 100644
d9682bf
--- a/src/mldap.c
d9682bf
+++ b/src/mldap.c
d9682bf
@@ -119,13 +119,13 @@ void mldap_cur_generation_bump(mldapdb_t *mldap) {
d9682bf
  * reference counter value.
d9682bf
  */
d9682bf
 STATIC_ASSERT((isc_uint32_t)
d9682bf
-		(typeof(isc_refcount_current((isc_refcount_t *)0)))
d9682bf
+		(typeof(((isc_refcount_t *)0)->refs))
d9682bf
 		-1
d9682bf
 	      == 0xFFFFFFFF, \
d9682bf
 	      "negative isc_refcount_t cannot be properly shortened to 32 bits");
d9682bf
 
d9682bf
 STATIC_ASSERT((isc_uint32_t)
d9682bf
-		(typeof(isc_refcount_current((isc_refcount_t *)0)))
d9682bf
+		(typeof(((isc_refcount_t *)0)->refs))
d9682bf
 		0x90ABCDEF12345678
d9682bf
 	      == 0x12345678, \
d9682bf
 	      "positive isc_refcount_t cannot be properly shortened to 32 bits");
d9682bf
diff --git a/src/rbt_helper.c b/src/rbt_helper.c
d9682bf
index 2a7e6cb..f610b07 100644
d9682bf
--- a/src/rbt_helper.c
d9682bf
+++ b/src/rbt_helper.c
d9682bf
@@ -2,6 +2,7 @@
d9682bf
  * Copyright (C) 2013-2014  bind-dyndb-ldap authors; see COPYING for license
d9682bf
  */
d9682bf
 
d9682bf
+#include <isc/util.h>
d9682bf
 #include <dns/rbt.h>
d9682bf
 
d9682bf
 #include "util.h"
d9682bf
diff --git a/src/types.h b/src/types.h
d9682bf
index 25ef3b9..01d627c 100644
d9682bf
--- a/src/types.h
d9682bf
+++ b/src/types.h
d9682bf
@@ -24,7 +24,7 @@
d9682bf
  * rdata1 -> rdata2 -> rdata3           rdata4 -> rdata5
d9682bf
  * next_rdatalist              ->       next_rdatalist  ...
d9682bf
  */
d9682bf
-typedef LIST(dns_rdatalist_t) ldapdb_rdatalist_t;
d9682bf
+typedef ISC_LIST(dns_rdatalist_t) ldapdb_rdatalist_t;
d9682bf
 
d9682bf
 typedef struct enum_txt_assoc {
d9682bf
 	int		value;
d9682bf
-- 
d9682bf
2.14.3
d9682bf