Commit fe79e2ef authored by Mark Andrews's avatar Mark Andrews
Browse files

4774. [bug] <isc/util.h> was incorrectly included in several

                        header files. [RT #46311]
parent b7b8e298
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]
......
......@@ -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>
......
......@@ -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>
......
......@@ -16,6 +16,7 @@
#include <isc/buffer.h>
#include <isc/mem.h>
#include <isc/string.h>
#include <isc/util.h>
#include <isccfg/cfg.h>
......
......@@ -13,6 +13,7 @@
#include <config.h>
#include <isc/string.h>
#include <isc/util.h>
#include <dns/db.h>
#include <dns/diff.h>
......
......@@ -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>
......
......@@ -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>
......
......@@ -45,6 +45,7 @@
***** Imports
*****/
#include <isc/deprecated.h>
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/ondestroy.h>
......
......@@ -10,12 +10,13 @@
#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>
......
......@@ -10,6 +10,7 @@
#include <isc/mem.h>
#include <isc/radix.h>
#include <isc/util.h>
#include <dns/acl.h>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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 \
......
......@@ -96,6 +96,7 @@
*** Imports
***/
#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/types.h>
......
/*
* 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
......@@ -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
......
/*
* 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 */
......@@ -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 */
......
......@@ -11,12 +11,13 @@
#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; \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment