Files
macports-ports/net/bind9/files/atomics.patch

57 lines
2.1 KiB
Diff

Avoid use of const pointers with atomic_load because strictly C11
compliant compilers error on this. Using const became allowed in C17:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2244.htm#dr_459
--- lib/isc/histo.c.orig 2024-07-08 23:09:17
+++ lib/isc/histo.c 2024-07-25 11:15:59
@@ -247,7 +247,7 @@ get_chunk(const isc_histo_t *hg, uint chunk) {
static hg_bucket_t *
get_chunk(const isc_histo_t *hg, uint chunk) {
- return atomic_load_acquire(&hg->chunk[chunk]);
+ return atomic_load_acquire((hg_chunk_t *)&hg->chunk[chunk]);
}
static inline hg_bucket_t *
@@ -261,7 +261,7 @@ bucket_count(const hg_bucket_t *bp) {
}
static inline uint64_t
-bucket_count(const hg_bucket_t *bp) {
+bucket_count(hg_bucket_t *bp) {
return bp == NULL ? 0 : atomic_load_relaxed(bp);
}
--- lib/isc/netmgr/netmgr-int.h.orig 2024-07-08 23:09:17
+++ lib/isc/netmgr/netmgr-int.h 2024-07-25 11:24:12
@@ -240,7 +240,7 @@ isc__nm_dump_active_manager(isc_nm_t *netmgr);
#define NMHANDLE_MAGIC ISC_MAGIC('N', 'M', 'H', 'D')
#define VALID_NMHANDLE(t) \
(ISC_MAGIC_VALID(t, NMHANDLE_MAGIC) && \
- atomic_load(&(t)->references) > 0)
+ atomic_load((isc_refcount_t *)&(t)->references) > 0)
typedef void (*isc__nm_closecb)(isc_nmhandle_t *);
typedef struct isc_nm_http_session isc_nm_http_session_t;
--- lib/dns/xfrin.c.orig 2024-07-08 23:09:17
+++ lib/dns/xfrin.c 2024-07-25 11:43:11
@@ -943,7 +943,7 @@ dns_xfrin_getstate(const dns_xfrin_t *xfr, const char
}
void
-dns_xfrin_getstate(const dns_xfrin_t *xfr, const char **statestr,
+dns_xfrin_getstate(dns_xfrin_t *xfr, const char **statestr,
bool *is_first_data_received, bool *is_ixfr) {
xfrin_state_t state;
--- lib/dns/include/dns/xfrin.h.orig 2024-07-08 23:09:17
+++ lib/dns/include/dns/xfrin.h 2024-07-25 11:48:36
@@ -104,7 +104,7 @@ dns_xfrin_getstate(const dns_xfrin_t *xfr, const char
*/
void
-dns_xfrin_getstate(const dns_xfrin_t *xfr, const char **statestr,
+dns_xfrin_getstate(dns_xfrin_t *xfr, const char **statestr,
bool *is_first_data_received, bool *is_ixfr);
/*%<
* Get the current state of the xfrin object as a character string, and whether