1diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
2index 6a858f7..9f338dc 100644
3--- a/src/dbinc/atomic.h
4+++ b/src/dbinc/atomic.h
5@@ -70,7 +70,7 @@ typedef struct {
6 * These have no memory barriers; the caller must include them when necessary.
7 */
8 #define atomic_read(p) ((p)->value)
9-#define atomic_init(p, val) ((p)->value = (val))
10+#define atomic_init_db(p, val) ((p)->value = (val))
11
12 #ifdef HAVE_ATOMIC_SUPPORT
13
14@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
15 #define atomic_inc(env, p) __atomic_inc(p)
16 #define atomic_dec(env, p) __atomic_dec(p)
17 #define atomic_compare_exchange(env, p, o, n) \
18- __atomic_compare_exchange((p), (o), (n))
19+ __atomic_compare_exchange_int((p), (o), (n))
20 static inline int __atomic_inc(db_atomic_t *p)
21 {
22 int temp;
23@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
24 * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
25 * which configure could be changed to use.
26 */
27-static inline int __atomic_compare_exchange(
28+static inline int __atomic_compare_exchange_int(
29 db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
30 {
31 atomic_value_t was;
32@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange(
33 #define atomic_dec(env, p) (--(p)->value)
34 #define atomic_compare_exchange(env, p, oldval, newval) \
35 (DB_ASSERT(env, atomic_read(p) == (oldval)), \
36- atomic_init(p, (newval)), 1)
37+ atomic_init_db(p, (newval)), 1)
38 #else
39 #define atomic_inc(env, p) __atomic_inc(env, p)
40 #define atomic_dec(env, p) __atomic_dec(env, p)
41diff --git a/src/mp/mp_fget.c b/src/mp/mp_fget.c
42index 16de695..d0dcc29 100644
43--- a/src/mp/mp_fget.c
44+++ b/src/mp/mp_fget.c
45@@ -649,7 +649,7 @@ alloc: /* Allocate a new buffer header and data space. */
46
47 /* Initialize enough so we can call __memp_bhfree. */
48 alloc_bhp->flags = 0;
49- atomic_init(&alloc_bhp->ref, 1);
50+ atomic_init_db(&alloc_bhp->ref, 1);
51 #ifdef DIAGNOSTIC
52 if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
53 __db_errx(env, DB_STR("3025",
54@@ -955,7 +955,7 @@ alloc: /* Allocate a new buffer header and data space. */
55 MVCC_MPROTECT(bhp->buf, mfp->pagesize,
56 PROT_READ);
57
58- atomic_init(&alloc_bhp->ref, 1);
59+ atomic_init_db(&alloc_bhp->ref, 1);
60 MUTEX_LOCK(env, alloc_bhp->mtx_buf);
61 alloc_bhp->priority = bhp->priority;
62 alloc_bhp->pgno = bhp->pgno;
63diff --git a/src/mp/mp_mvcc.c b/src/mp/mp_mvcc.c
64index 770bad8..e28cce0 100644
65--- a/src/mp/mp_mvcc.c
66+++ b/src/mp/mp_mvcc.c
67@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
68 #else
69 memcpy(frozen_bhp, bhp, SSZA(BH, buf));
70 #endif
71- atomic_init(&frozen_bhp->ref, 0);
72+ atomic_init_db(&frozen_bhp->ref, 0);
73 if (mutex != MUTEX_INVALID)
74 frozen_bhp->mtx_buf = mutex;
75 else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
76@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
77 #endif
78 alloc_bhp->mtx_buf = mutex;
79 MUTEX_LOCK(env, alloc_bhp->mtx_buf);
80- atomic_init(&alloc_bhp->ref, 1);
81+ atomic_init_db(&alloc_bhp->ref, 1);
82 F_CLR(alloc_bhp, BH_FROZEN);
83 }
84
85diff --git a/src/mp/mp_region.c b/src/mp/mp_region.c
86index 4952030..47645f8 100644
87--- a/src/mp/mp_region.c
88+++ b/src/mp/mp_region.c
89@@ -245,7 +245,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
90 MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
91 return (ret);
92 SH_TAILQ_INIT(&htab[i].hash_bucket);
93- atomic_init(&htab[i].hash_page_dirty, 0);
94+ atomic_init_db(&htab[i].hash_page_dirty, 0);
95 }
96
97 /*
98@@ -302,7 +302,7 @@ no_prealloc:
99 } else
100 hp->mtx_hash = mtx_base + (i % dbenv->mp_mtxcount);
101 SH_TAILQ_INIT(&hp->hash_bucket);
102- atomic_init(&hp->hash_page_dirty, 0);
103+ atomic_init_db(&hp->hash_page_dirty, 0);
104 #ifdef HAVE_STATISTICS
105 hp->hash_io_wait = 0;
106 hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
107diff --git a/src/mutex/mut_method.c b/src/mutex/mut_method.c
108index 09353b0..177353c 100644
109--- a/src/mutex/mut_method.c
110+++ b/src/mutex/mut_method.c
111@@ -474,7 +474,7 @@ atomic_compare_exchange(env, v, oldval, newval)
112 MUTEX_LOCK(env, mtx);
113 ret = atomic_read(v) == oldval;
114 if (ret)
115- atomic_init(v, newval);
116+ atomic_init_db(v, newval);
117 MUTEX_UNLOCK(env, mtx);
118
119 return (ret);
120diff --git a/src/mutex/mut_tas.c b/src/mutex/mut_tas.c
121index 106b161..fc4de9d 100644
122--- a/src/mutex/mut_tas.c
123+++ b/src/mutex/mut_tas.c
124@@ -47,7 +47,7 @@ __db_tas_mutex_init(env, mutex, flags)
125
126 #ifdef HAVE_SHARED_LATCHES
127 if (F_ISSET(mutexp, DB_MUTEX_SHARED))
128- atomic_init(&mutexp->sharecount, 0);
129+ atomic_init_db(&mutexp->sharecount, 0);
130 else
131 #endif
132 if (MUTEX_INIT(&mutexp->tas)) {
133@@ -536,7 +536,7 @@ __db_tas_mutex_unlock(env, mutex)
134 F_CLR(mutexp, DB_MUTEX_LOCKED);
135 /* Flush flag update before zeroing count */
136 MEMBAR_EXIT();
137- atomic_init(&mutexp->sharecount, 0);
138+ atomic_init_db(&mutexp->sharecount, 0);
139 } else {
140 DB_ASSERT(env, sharecount > 0);
141 MEMBAR_EXIT();
142diff -ur a/dist/aclocal/clock.m4 b/dist/aclocal/clock.m4
143--- a/dist/aclocal/clock.m4 1969-12-31 19:00:01.000000000 -0500
144+++ b/dist/aclocal/clock.m4 2023-06-05 19:14:02.007080500 -0400
145@@ -21,6 +21,7 @@
146 AC_CACHE_CHECK([for clock_gettime monotonic clock], db_cv_clock_monotonic, [
147 AC_TRY_RUN([
148 #include <sys/time.h>
149+int
150 main() {
151 struct timespec t;
152 return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
153diff -ur a/dist/aclocal/mmap.m4 b/dist/aclocal/mmap.m4
154--- a/dist/aclocal/mmap.m4 1969-12-31 19:00:01.000000000 -0500
155+++ b/dist/aclocal/mmap.m4 2023-06-05 19:14:02.007323624 -0400
156@@ -29,6 +29,8 @@
157 * system to system.
158 */
159 #include <stdio.h>
160+ #include <stdlib.h>
161+ #include <unistd.h>
162 #include <string.h>
163 #include <sys/types.h>
164 #include <sys/stat.h>
165@@ -42,12 +44,13 @@
166 #define MAP_FAILED (-1)
167 #endif
168
169- int catch_sig(sig)
170+ void catch_sig(sig)
171 int sig;
172 {
173 exit(1);
174 }
175
176+ int
177 main() {
178 const char *underlying;
179 unsigned gapsize;
180@@ -88,8 +91,8 @@
181 return (4);
182 }
183
184- (void) signal(SIGSEGV, catch_sig);
185- (void) signal(SIGBUS, catch_sig);
186+ (void) signal(SIGSEGV, &catch_sig);
187+ (void) signal(SIGBUS, &catch_sig);
188
189 for (i = sizeof(buf); i < total_size; i += gapsize)
190 base[i] = 'A';
191diff -ur a/dist/aclocal/mutex.m4 b/dist/aclocal/mutex.m4
192--- a/dist/aclocal/mutex.m4 1969-12-31 19:00:01.000000000 -0500
193+++ b/dist/aclocal/mutex.m4 2023-06-05 19:14:47.214158196 -0400
194@@ -5,6 +5,7 @@
195 AC_TRY_RUN([
196 #include <stdlib.h>
197 #include <pthread.h>
198+int
199 main() {
200 pthread_cond_t cond;
201 pthread_mutex_t mutex;
202@@ -49,6 +50,7 @@
203 AC_TRY_RUN([
204 #include <stdlib.h>
205 #include <pthread.h>
206+int
207 main() {
208 pthread_cond_t cond;
209 pthread_mutex_t mutex;
210@@ -89,6 +91,7 @@
211 AC_TRY_RUN([
212 #include <stdlib.h>
213 #include <pthread.h>
214+int
215 main() {
216 pthread_cond_t cond;
217 pthread_condattr_t condattr;
218@@ -110,6 +113,7 @@
219 AC_TRY_RUN([
220 #include <stdlib.h>
221 #include <pthread.h>
222+int
223 main() {
224 pthread_rwlock_t rwlock;
225 pthread_rwlockattr_t rwlockattr;
226diff -ur a/dist/aclocal/sequence.m4 b/dist/aclocal/sequence.m4
227--- a/dist/aclocal/sequence.m4 1969-12-31 19:00:01.000000000 -0500
228+++ b/dist/aclocal/sequence.m4 2023-06-05 19:14:02.007869956 -0400
229@@ -43,6 +43,9 @@
230 # test, which won't test for the appropriate printf format strings.
231 if test "$db_cv_build_sequence" = "yes"; then
232 AC_TRY_RUN([
233+ #include <string.h>
234+ #include <stdio.h>
235+ int
236 main() {
237 $db_cv_seq_type l;
238 unsigned $db_cv_seq_type u;
239@@ -59,7 +62,9 @@
240 return (1);
241 return (0);
242 }],, [db_cv_build_sequence="no"],
243- AC_TRY_LINK(,[
244+ AC_TRY_LINK([
245+ #include <string.h>
246+ #include <stdio.h>],[
247 $db_cv_seq_type l;
248 unsigned $db_cv_seq_type u;
249 char buf@<:@100@:>@;