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