]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4774. [bug] <isc/util.h> was incorrectly included in several
authorMark Andrews <marka@isc.org>
Thu, 19 Oct 2017 01:26:32 +0000 (12:26 +1100)
committerMark Andrews <marka@isc.org>
Thu, 19 Oct 2017 01:26:32 +0000 (12:26 +1100)
                        header files. [RT #46311]

25 files changed:
CHANGES
bin/named/logconf.c
bin/named/statschannel.c
bin/named/tsigconf.c
bin/tests/system/dyndb/driver/db.c
bin/tests/system/dyndb/driver/syncptr.c
lib/dns/catz.c
lib/dns/include/dns/db.h
lib/dns/include/dns/rpz.h
lib/dns/iptable.c
lib/dns/private.c
lib/dns/rrl.c
lib/dns/tsec.c
lib/isc/include/isc/Makefile.in
lib/isc/include/isc/buffer.h
lib/isc/include/isc/deprecated.h [new file with mode: 0644]
lib/isc/include/isc/hash.h
lib/isc/include/isc/likely.h [new file with mode: 0644]
lib/isc/include/isc/magic.h
lib/isc/include/isc/refcount.h
lib/isc/include/isc/util.h
lib/isc/refcount.c
lib/isc/x86_32/include/isc/atomic.h
lib/isc/x86_64/include/isc/atomic.h
lib/ns/server.c

diff --git a/CHANGES b/CHANGES
index 0246afed7c82094b2705212a02b26a5ba3462b44..8c3fd4ede6db976045cd0be8bd3ba1c4a058d8ac 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4774.  [bug]           <isc/util.h> was incorrectly included in several
+                       header files. [RT #46311]
+
 4773.  [doc]           Fixed generating Doxygen documentation for functions
                        annotated using certain macros.  Miscellaneous
                        Doxygen-related cleanups. [RT #46276]
index c573bf8e313cc2f13f2c7431cd87544679270c19..e686cc228617d2fa48e958f78358088b4f1b4bf3 100644 (file)
@@ -17,6 +17,7 @@
 #include <isc/stdio.h>
 #include <isc/string.h>
 #include <isc/syslog.h>
+#include <isc/util.h>
 
 #include <isccfg/cfg.h>
 #include <isccfg/log.h>
index 58992215486497be79e0116daec68e02402e5fe2..b9370f875aef6024cf88a66ca372c018054b5eb6 100644 (file)
@@ -20,6 +20,7 @@
 #include <isc/stats.h>
 #include <isc/string.h>
 #include <isc/task.h>
+#include <isc/util.h>
 
 #include <dns/cache.h>
 #include <dns/db.h>
index e892b4d1f4dd4317a60a86c8341278b5cae7b281..7f58a8112e82ba77296a31b87d7adeb03d6ebc86 100644 (file)
@@ -16,6 +16,7 @@
 #include <isc/buffer.h>
 #include <isc/mem.h>
 #include <isc/string.h>
+#include <isc/util.h>
 
 #include <isccfg/cfg.h>
 
index 8d642021b6d299663a2111b1bbfa7da4f3a1e8e3..f3f03c8dde2d38ae8f07edb4c8d109f847fe97b0 100644 (file)
@@ -13,6 +13,7 @@
 #include <config.h>
 
 #include <isc/string.h>
+#include <isc/util.h>
 
 #include <dns/db.h>
 #include <dns/diff.h>
index 2191bae087b662cbd209c38b1ecd64fa7cc1e2ce..7ca2d3f2794b32d16bad6f8d93d39bc569f86e15 100644 (file)
@@ -10,6 +10,7 @@
 #include <isc/eventclass.h>
 #include <isc/netaddr.h>
 #include <isc/task.h>
+#include <isc/util.h>
 
 #include <dns/byaddr.h>
 #include <dns/db.h>
index 156b37ed20650dd4a9563d3bd62a7cf5dd1aac30..eaa30c2a304ca9cbb3556ab9fe4a5f34a5788499 100644 (file)
@@ -17,6 +17,7 @@
 #include <isc/result.h>
 #include <isc/sha2.h>
 #include <isc/task.h>
+#include <isc/util.h>
 
 #include <dns/catz.h>
 #include <dns/dbiterator.h>
index 2a8f315996faf42eab5842fbb081a9165b29ab0b..0eb310aa1c25c30517ecad7c786d406e5b7c031f 100644 (file)
@@ -45,6 +45,7 @@
  ***** Imports
  *****/
 
+#include <isc/deprecated.h>
 #include <isc/lang.h>
 #include <isc/magic.h>
 #include <isc/ondestroy.h>
index 2fd604128a4349918d0cf2b87d27394d4d0c4260..e59fa8abd777507af9142dd75aae5c8d385e607a 100644 (file)
 #ifndef DNS_RPZ_H
 #define DNS_RPZ_H 1
 
+#include <isc/deprecated.h>
+#include <isc/event.h>
+#include <isc/ht.h>
 #include <isc/lang.h>
 #include <isc/refcount.h>
 #include <isc/rwlock.h>
-#include <isc/ht.h>
 #include <isc/time.h>
-#include <isc/event.h>
 #include <isc/timer.h>
 
 #include <dns/fixedname.h>
index 2522c4aa8188355acab4b3cbc45363495e4e82c8..c02a1f0125bc1d61a055651fb1272cdd109f9528 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <isc/mem.h>
 #include <isc/radix.h>
+#include <isc/util.h>
 
 #include <dns/acl.h>
 
index a305d8a22b15c54fa88fd033bb12bd0a7643bc7e..51e3d0aea1f2fbf2f20e9cfc86a4160144a711f0 100644 (file)
@@ -6,8 +6,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* $Id$ */
-
 #include "config.h"
 
 #include <isc/base64.h>
@@ -15,6 +13,7 @@
 #include <isc/result.h>
 #include <isc/string.h>
 #include <isc/types.h>
+#include <isc/util.h>
 
 #include <dns/nsec3.h>
 #include <dns/private.h>
index 31166ed610ce22251ec5ac74e33304cbd1d44766..2c346e9bff63519485c288f1829753cd3984f6d9 100644 (file)
@@ -19,6 +19,7 @@
 #include <isc/net.h>
 #include <isc/netaddr.h>
 #include <isc/print.h>
+#include <isc/util.h>
 
 #include <dns/result.h>
 #include <dns/rcode.h>
index 11d1f8517dbcde28eba5bcfd6b6264ec608e34bd..39dfec30b22652f251ed9a712ebea2117bc4e8df 100644 (file)
@@ -6,11 +6,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* $Id: tsec.c,v 1.7 2010/12/09 00:54:34 marka Exp $ */
-
 #include <config.h>
 
 #include <isc/mem.h>
+#include <isc/util.h>
 
 #include <pk11/site.h>
 
index 505b263ed765a445c560927282d691ca4cdff674..26d4203b14c56d0bd717789b76c0c7ca550bdc75 100644 (file)
@@ -17,12 +17,12 @@ VERSION=@BIND9_VERSION@
 #
 HEADERS =      aes.h app.h assertions.h backtrace.h base32.h base64.h \
                bind9.h boolean.h buffer.h bufferlist.h \
-               commandline.h counter.h crc64.h \
+               commandline.h counter.h crc64.h deprecated.h \
                entropy.h errno.h error.h event.h eventclass.h \
                file.h formatcheck.h fsaccess.h fuzz.h \
                hash.h heap.h hex.h hmacmd5.h hmacsha.h ht.h httpd.h \
                interfaceiter.h @ISC_IPV6_H@ iterated_hash.h \
-               json.h lang.h lex.h lfsr.h lib.h list.h log.h \
+               json.h lang.h lex.h lfsr.h lib.h likely.h list.h log.h \
                magic.h md5.h mem.h meminfo.h msgcat.h msgs.h mutexblock.h \
                netaddr.h netscope.h ondestroy.h os.h parseint.h \
                pool.h portset.h print.h queue.h quota.h \
index ae9fc412b83a9f4c0160b796310dbb49744cc6e1..c4f21b774df46908fc8e28c073e479ec959d5350 100644 (file)
@@ -96,6 +96,7 @@
  *** Imports
  ***/
 
+#include <isc/formatcheck.h>
 #include <isc/lang.h>
 #include <isc/magic.h>
 #include <isc/types.h>
diff --git a/lib/isc/include/isc/deprecated.h b/lib/isc/include/isc/deprecated.h
new file mode 100644 (file)
index 0000000..0b7f2a0
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+
+#ifndef ISC_DEPRECATED_H
+#define ISC_DEPRECATED_H
+
+#ifdef __GNUC__
+#define ISC_DEPRECATED                  __attribute__((deprecated))
+#else
+#define ISC_DEPRECATED                  /* none */
+#endif /* __GNUC __ */
+
+#endif
index 8e007a380b4b91ccf32ff4c37d5c2a06dbacffd5..e2f8fe46ca270d2046359119f9c9216f5592f26a 100644 (file)
@@ -9,8 +9,8 @@
 #ifndef ISC_HASH_H
 #define ISC_HASH_H 1
 
+#include <isc/deprecated.h>
 #include <isc/types.h>
-#include <isc/util.h>
 
 /*****
  ***** Module Info
diff --git a/lib/isc/include/isc/likely.h b/lib/isc/include/isc/likely.h
new file mode 100644 (file)
index 0000000..14161a2
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef ISC_LIKELY_H
+#define ISC_LIKELY_H 1
+
+/*%
+ * Performance
+ */
+#ifdef HAVE_BUILTIN_EXPECT
+#define ISC_LIKELY(x)            __builtin_expect(!!(x), 1)
+#define ISC_UNLIKELY(x)          __builtin_expect(!!(x), 0)
+#else
+#define ISC_LIKELY(x)            (x)
+#define ISC_UNLIKELY(x)          (x)
+#endif
+
+#endif /* ISC_LIKELY_H */
index 6c4d54d40307195931d55594581893a204b98f6d..16099cf7f85e44acbe6fe7009e095eb12ae6c91c 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef ISC_MAGIC_H
 #define ISC_MAGIC_H 1
 
-#include <isc/util.h>
+#include <isc/likely.h>
 
 /*! \file isc/magic.h */
 
index 24ad9dae945ba7b00ccc3de76c2d3c8087a0b3f7..705cf12f949cb041402d40791a69a93e23f6db9c 100644 (file)
 #ifndef ISC_REFCOUNT_H
 #define ISC_REFCOUNT_H 1
 
+#include <isc/assertions.h>
 #include <isc/atomic.h>
+#include <isc/error.h>
 #include <isc/lang.h>
 #include <isc/mutex.h>
 #include <isc/platform.h>
 #include <isc/types.h>
-#include <isc/util.h>
 
 #if defined(ISC_PLATFORM_HAVESTDATOMIC)
 #include <stdatomic.h>
@@ -109,7 +110,7 @@ typedef struct isc_refcount {
 #define isc_refcount_current(rp)                                       \
        ((unsigned int)(atomic_load_explicit(&(rp)->refs,               \
                                             memory_order_relaxed)))
-#define isc_refcount_destroy(rp) REQUIRE(isc_refcount_current(rp) == 0)
+#define isc_refcount_destroy(rp) ISC_REQUIRE(isc_refcount_current(rp) == 0)
 
 #define isc_refcount_increment0(rp, tp)                                \
        do {                                                    \
@@ -127,7 +128,7 @@ typedef struct isc_refcount {
                isc_int32_t prev;                               \
                prev = atomic_fetch_add_explicit                \
                        (&(rp)->refs, 1, memory_order_relaxed); \
-               REQUIRE(prev > 0);                              \
+               ISC_REQUIRE(prev > 0);                          \
                if (_tmp != NULL)                               \
                        *_tmp = prev + 1;                       \
        } while (0)
@@ -138,7 +139,7 @@ typedef struct isc_refcount {
                isc_int32_t prev;                               \
                prev = atomic_fetch_sub_explicit                \
                        (&(rp)->refs, 1, memory_order_relaxed); \
-               REQUIRE(prev > 0);                              \
+               ISC_REQUIRE(prev > 0);                          \
                if (_tmp != NULL)                               \
                        *_tmp = prev - 1;                       \
        } while (0)
@@ -147,7 +148,7 @@ typedef struct isc_refcount {
 
 #define isc_refcount_current(rp)                               \
        ((unsigned int)(isc_atomic_xadd(&(rp)->refs, 0)))
-#define isc_refcount_destroy(rp) REQUIRE(isc_refcount_current(rp) == 0)
+#define isc_refcount_destroy(rp) ISC_REQUIRE(isc_refcount_current(rp) == 0)
 
 #define isc_refcount_increment0(rp, tp)                                \
        do {                                                    \
@@ -163,7 +164,7 @@ typedef struct isc_refcount {
                unsigned int *_tmp = (unsigned int *)(tp);      \
                isc_int32_t prev;                               \
                prev = isc_atomic_xadd(&(rp)->refs, 1);         \
-               REQUIRE(prev > 0);                              \
+               ISC_REQUIRE(prev > 0);                          \
                if (_tmp != NULL)                               \
                        *_tmp = prev + 1;                       \
        } while (0)
@@ -173,7 +174,7 @@ typedef struct isc_refcount {
                unsigned int *_tmp = (unsigned int *)(tp);      \
                isc_int32_t prev;                               \
                prev = isc_atomic_xadd(&(rp)->refs, -1);        \
-               REQUIRE(prev > 0);                              \
+               ISC_REQUIRE(prev > 0);                          \
                if (_tmp != NULL)                               \
                        *_tmp = prev - 1;                       \
        } while (0)
@@ -188,46 +189,63 @@ typedef struct isc_refcount {
 } isc_refcount_t;
 
 /*% Destroys a reference counter. */
-#define isc_refcount_destroy(rp)                       \
-       do {                                            \
-               REQUIRE((rp)->refs == 0);               \
-               DESTROYLOCK(&(rp)->lock);               \
+#define isc_refcount_destroy(rp)                                       \
+       do {                                                            \
+               isc_result_t _result;                                   \
+               ISC_REQUIRE((rp)->refs == 0);                           \
+               _result = isc_mutex_destroy(&(rp)->lock);               \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
        } while (0)
 
 #define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
 
-/*% Increments the reference count, returning the new value in targetp if it's not NULL. */
-#define isc_refcount_increment0(rp, tp)                                \
-       do {                                                    \
-               unsigned int *_tmp = (unsigned int *)(tp);      \
-               LOCK(&(rp)->lock);                              \
-               ++((rp)->refs);                                 \
-               if (_tmp != NULL)                               \
-                       *_tmp = ((rp)->refs);                   \
-               UNLOCK(&(rp)->lock);                            \
+/*%
+ * Increments the reference count, returning the new value in
+ * 'tp' if it's not NULL.
+ */
+#define isc_refcount_increment0(rp, tp)                                        \
+       do {                                                            \
+               isc_result_t _result;                                   \
+               unsigned int *_tmp = (unsigned int *)(tp);              \
+               _result = isc_mutex_lock(&(rp)->lock);                  \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
+               ++((rp)->refs);                                         \
+               if (_tmp != NULL)                                       \
+                       *_tmp = ((rp)->refs);                           \
+               _result = isc_mutex_unlock(&(rp)->lock);                \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
        } while (0)
 
-#define isc_refcount_increment(rp, tp)                         \
-       do {                                                    \
-               unsigned int *_tmp = (unsigned int *)(tp);      \
-               LOCK(&(rp)->lock);                              \
-               REQUIRE((rp)->refs > 0);                        \
-               ++((rp)->refs);                                 \
-               if (_tmp != NULL)                               \
-                       *_tmp = ((rp)->refs);                   \
-               UNLOCK(&(rp)->lock);                            \
+#define isc_refcount_increment(rp, tp)                                 \
+       do {                                                            \
+               isc_result_t _result;                                   \
+               unsigned int *_tmp = (unsigned int *)(tp);              \
+               _result = isc_mutex_lock(&(rp)->lock);                  \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
+               ISC_REQUIRE((rp)->refs > 0);                            \
+               ++((rp)->refs);                                         \
+               if (_tmp != NULL)                                       \
+                       *_tmp = ((rp)->refs);                           \
+               _result = isc_mutex_unlock(&(rp)->lock);                \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
        } while (0)
 
-/*% Decrements the reference count,  returning the new value in targetp if it's not NULL. */
-#define isc_refcount_decrement(rp, tp)                         \
-       do {                                                    \
-               unsigned int *_tmp = (unsigned int *)(tp);      \
-               LOCK(&(rp)->lock);                              \
-               REQUIRE((rp)->refs > 0);                        \
-               --((rp)->refs);                                 \
-               if (_tmp != NULL)                               \
-                       *_tmp = ((rp)->refs);                   \
-               UNLOCK(&(rp)->lock);                            \
+/*%
+ * Decrements the reference count, returning the new value in 'tp'
+ * if it's not NULL.
+ */
+#define isc_refcount_decrement(rp, tp)                                 \
+       do {                                                            \
+               isc_result_t _result;                                   \
+               unsigned int *_tmp = (unsigned int *)(tp);              \
+               _result = isc_mutex_lock(&(rp)->lock);                  \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
+               ISC_REQUIRE((rp)->refs > 0);                            \
+               --((rp)->refs);                                         \
+               if (_tmp != NULL)                                       \
+                       *_tmp = ((rp)->refs);                           \
+               _result = isc_mutex_unlock(&(rp)->lock);                \
+               ISC_ERROR_RUNTIMECHECK(_result == ISC_R_SUCCESS);       \
        } while (0)
 
 #endif /* (defined(ISC_PLATFORM_HAVESTDATOMIC) && defined(ATOMIC_INT_LOCK_FREE)) || defined(ISC_PLATFORM_HAVEXADD) */
@@ -237,7 +255,7 @@ typedef struct isc_refcount {
        int refs;
 } isc_refcount_t;
 
-#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0)
+#define isc_refcount_destroy(rp) ISC_REQUIRE((rp)->refs == 0)
 #define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
 
 #define isc_refcount_increment0(rp, tp)                                        \
@@ -252,7 +270,7 @@ typedef struct isc_refcount {
        do {                                                            \
                unsigned int *_tmp = (unsigned int *)(tp);              \
                int _n;                                                 \
-               REQUIRE((rp)->refs > 0);                                \
+               ISC_REQUIRE((rp)->refs > 0);                            \
                _n = ++(rp)->refs;                                      \
                if (_tmp != NULL)                                       \
                        *_tmp = _n;                                     \
@@ -262,7 +280,7 @@ typedef struct isc_refcount {
        do {                                                            \
                unsigned int *_tmp = (unsigned int *)(tp);              \
                int _n;                                                 \
-               REQUIRE((rp)->refs > 0);                                \
+               ISC_REQUIRE((rp)->refs > 0);                            \
                _n = --(rp)->refs;                                      \
                if (_tmp != NULL)                                       \
                        *_tmp = _n;                                     \
index f2cda262c35c7eae74bef935e90623bd76ed464f..c85d52ac8c70dab6e6bfbad43215c42d70b02330 100644 (file)
@@ -6,8 +6,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* $Id$ */
-
 #ifndef ISC_UTIL_H
 #define ISC_UTIL_H 1
 
 /*%
  * Performance
  */
-#ifdef HAVE_BUILTIN_EXPECT
-#define ISC_LIKELY(x)            __builtin_expect(!!(x), 1)
-#define ISC_UNLIKELY(x)          __builtin_expect(!!(x), 0)
-#else
-#define ISC_LIKELY(x)            (x)
-#define ISC_UNLIKELY(x)          (x)
-#endif
+#include <isc/likely.h>
 
 /*
  * Assertions
 #define TIME_NOW(tp)   RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
 
 /*%
- * Misc.
+ * Misc
  */
-#ifdef __GNUC__
-#define ISC_DEPRECATED                 __attribute__((deprecated))
-#else
-#define ISC_DEPRECATED                 /* none */
-#endif /* __GNUC __ */
+#include <isc/deprecated.h>
 
 #endif /* ISC_UTIL_H */
index 2fee52d997acf769d4a37efdd501b310a6db85be..e5820f497efa51b916cf98eaca992ccd4af928e3 100644 (file)
@@ -15,6 +15,7 @@
 #include <isc/mutex.h>
 #include <isc/refcount.h>
 #include <isc/result.h>
+#include <isc/util.h>
 
 isc_result_t
 isc_refcount_init(isc_refcount_t *ref, unsigned int n) {
index 17005a2466af4e9b83db0cbe7ac9c806e6b9c9dd..c8b121158c1b078a7d4607b309934d9a8c7c5fa3 100644 (file)
@@ -122,12 +122,10 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
  * positions of the stack frame, which would not actually point to the
  * intended address in the embedded mnemonic.
  */
-#include <isc/util.h>          /* for 'UNUSED' macro */
-
 static isc_int32_t
 isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
-       UNUSED(p);
-       UNUSED(val);
+       (void)(p);
+       (void)(val);
 
        __asm (
                "movl 8(%ebp), %ecx\n"
@@ -148,8 +146,8 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
 
 static void
 isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
-       UNUSED(p);
-       UNUSED(val);
+       (void)(p);
+       (void)(val);
 
        __asm (
                "movl 8(%ebp), %ecx\n"
@@ -163,9 +161,9 @@ isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
 
 static isc_int32_t
 isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
-       UNUSED(p);
-       UNUSED(cmpval);
-       UNUSED(val);
+       (void)(p);
+       (void)(cmpval);
+       (void)(val);
 
        __asm (
                "movl 8(%ebp), %ecx\n"
index f0267834df730f122add3e2ec84bff92d9a88f51..ef5140f1ecd30ea72fdf431e184d1379c38fe8d6 100644 (file)
  * registers for arguments, which would not actually correspond to the
  * intended address or value in the embedded mnemonic.
  */
-#include <isc/util.h>          /* for 'UNUSED' macro */
 
 static isc_int32_t
 isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
-       UNUSED(p);
-       UNUSED(val);
+       (void)(p);
+       (void)(val);
 
        __asm (
                "movq %rdi, %rdx\n"
@@ -50,8 +49,8 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
 #ifdef ISC_PLATFORM_HAVEXADDQ
 static isc_int64_t
 isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) {
-       UNUSED(p);
-       UNUSED(val);
+       (void)(p);
+       (void)(val);
 
        __asm (
                "movq %rdi, %rdx\n"
@@ -69,8 +68,8 @@ isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) {
 
 static void
 isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
-       UNUSED(p);
-       UNUSED(val);
+       (void)(p);
+       (void)(val);
 
        __asm (
                "movq %rdi, %rax\n"
@@ -85,8 +84,8 @@ isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
 #ifdef ISC_PLATFORM_HAVEATOMICSTOREQ
 static void
 isc_atomic_storeq(isc_int64_t *p, isc_int64_t val) {
-       UNUSED(p);
-       UNUSED(val);
+       (void)(p);
+       (void)(val);
 
        __asm (
                "movq %rdi, %rax\n"
@@ -101,9 +100,9 @@ isc_atomic_storeq(isc_int64_t *p, isc_int64_t val) {
 
 static isc_int32_t
 isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
-       UNUSED(p);
-       UNUSED(cmpval);
-       UNUSED(val);
+       (void)(p);
+       (void)(cmpval);
+       (void)(val);
 
        __asm (
                /*
index 2c5dc36251cf944c2248fcbbd9dc8687a97b28f1..559704fec6736baae760de9a93565ce40cd66d87 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <isc/mem.h>
 #include <isc/stats.h>
+#include <isc/util.h>
 
 #include <dns/tkey.h>
 #include <dns/stats.h>