Index: pbx/pbx_dundi.c =================================================================== --- pbx/pbx_dundi.c (revision 92264) +++ pbx/pbx_dundi.c (working copy) @@ -36,6 +36,10 @@ #include #include #include +#if defined(__NetBSD__) +#include +#include +#endif #include "asterisk/file.h" #include "asterisk/logger.h" Index: utils/extconf.c =================================================================== --- utils/extconf.c (revision 92264) +++ utils/extconf.c (working copy) @@ -1756,8 +1756,19 @@ * as ast_atomic_fetchadd_int_slow() */ -int ast_atomic_fetchadd_int_slow(volatile int *p, int v); +AST_MUTEX_DEFINE_STATIC(fetchadd_m); /* used for all fetc&add ops */ +int ast_atomic_fetchadd_int_slow(volatile int *p, int v) +{ + int ret; + ast_mutex_lock(&fetchadd_m); + ret = *p; + *p += v; + ast_mutex_unlock(&fetchadd_m); + return ret; +} + + #if defined(HAVE_OSX_ATOMICS) #include "libkern/OSAtomic.h" #endif Index: utils/Makefile =================================================================== --- utils/Makefile (revision 92264) +++ utils/Makefile (working copy) @@ -29,6 +29,10 @@ UTILS:=$(filter-out muted,$(UTILS)) endif +ifeq ($(OSARCH),NetBSD) + UTILS:=$(filter-out muted,$(UTILS)) +endif + ifeq ($(OSARCH),OpenBSD) UTILS:=$(filter-out muted,$(UTILS)) endif