--- ./third_party/heimdal/lib/base/heimbase-atomics.h_orig	2023-01-23 03:05:31.563030540 +0000
+++ ./third_party/heimdal/lib/base/heimbase-atomics.h	2023-01-23 03:09:55.504006267 +0000
@@ -105,10 +105,10 @@
 
 #define heim_base_atomic_barrier()	__isync()
 
-#define heim_base_atomic_inc(x)		(fetch_and_add((atomic_p)(x)) + 1)
-#define heim_base_atomic_dec(x)		(fetch_and_add((atomic_p)(x)) - 1)
-#define heim_base_atomic_integer_type	unsigned int
-#define heim_base_atomic_integer_max	UINT_MAX
+#define heim_base_atomic_inc(x)		(fetch_and_addlp((atomic_l)(x),  1) + 1)
+#define heim_base_atomic_dec(x)		(fetch_and_addlp((atomic_l)(x), -1) - 1)
+#define heim_base_atomic_integer_type	long
+#define heim_base_atomic_integer_max	LONG_MAX
 
 static inline void *
 heim_base_exchange_pointer(void *p, void *newval)
