]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove superflous header includes from isc/util.h header
authorOndřej Surý <ondrej@isc.org>
Fri, 28 Feb 2025 20:40:50 +0000 (21:40 +0100)
committerOndřej Surý <ondrej@isc.org>
Sat, 1 Mar 2025 06:33:40 +0000 (07:33 +0100)
Formerly, isc/util.h would pull a few extra headers (isc/list.h,
isc/attributes.h, isc/result.h and errno.h).  These includes were
removed in favor of including them directly when used.

lib/isc/include/isc/rwlock.h
lib/isc/include/isc/util.h

index 16cbe536d8d271bd92b74ddf339c305104b14d10..b636fbc37cb19e4d53c6bce33daf9475e03aad29 100644 (file)
@@ -14,7 +14,6 @@
 #pragma once
 
 #include <inttypes.h>
-#include <stdlib.h>
 
 /*! \file isc/rwlock.h */
 
@@ -28,6 +27,7 @@ typedef enum {
 } isc_rwlocktype_t;
 
 #if USE_PTHREAD_RWLOCK
+#include <errno.h>
 #include <pthread.h>
 
 /*
@@ -38,6 +38,8 @@ typedef enum {
 
 #if ISC_TRACK_PTHREADS_OBJECTS
 
+#include <stdlib.h>
+
 typedef pthread_rwlock_t *isc_rwlock_t;
 typedef pthread_rwlock_t  isc__rwlock_t;
 
index bcfe3ad2aed6ad48f29b7f01fdffb54e07f492a3..a392714e180cc4671c22d6c308fb3a2f6d6d8b23 100644 (file)
@@ -27,8 +27,6 @@
  * ISC_ or isc_ to the name.
  */
 
-#include <isc/attributes.h>
-
 /***
  *** Clang Compatibility Macros
  ***/
 #define ISC_UTIL_TRACE(a)
 #endif /* ifdef ISC_UTIL_TRACEON */
 
-#include <isc/result.h> /* Contractual promise. */
-
 #define SPINLOCK(sp)                                                           \
        {                                                                      \
                ISC_UTIL_TRACE(fprintf(stderr, "SPINLOCKING %p %s %d\n", (sp), \
                INSIST(locktype == isc_rwlocktype_write);                   \
        }
 
-/*
- * List Macros.
- */
-#include <isc/list.h> /* Contractual promise. */
-
 /*%
  * Performance
  */
@@ -318,8 +309,6 @@ mock_assert(const int result, const char *const expression,
 /*
  * Errors
  */
-#include <errno.h> /* for errno */
-
 #include <isc/error.h> /* Contractual promise. */
 #include <isc/strerr.h> /* for ISC_STRERRORSIZE */