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