head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.11.09.05.37.22; author jnemeth; state Exp; branches; next ; commitid nfklAD0yCz3anK2H; desc @@ 1.1 log @comms/asterisk24: import asterisk-24.0.0 Asterisk is a complete PBX in software. It provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in three protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware. Asterisk provides Voicemail services with Directory, Call Conferencing, Interactive Voice Response, Call Queuing. It has support for three-way calling, caller ID services, ADSI, SIP and H.323 (as both client and gateway). This is a Long Term Support version. It is scheduled to go to security fixes only on October 15th, 2030, and EOL on October 15th, 2031. See here for more information about Asterisk versions: https://docs.asterisk.org/About-the-Project/Asterisk-Versions/ @ text @$NetBSD: patch-utils_extconf.c,v 1.1 2025/10/27 06:58:41 jnemeth Exp $ --- utils/extconf.c.orig 2015-10-09 21:48:48.000000000 +0000 +++ utils/extconf.c @@@@ -593,6 +593,10 @@@@ static void __attribute__((destructor)) #include "libkern/OSAtomic.h" #endif +#if defined(HAVE_SYS_ATOMIC_H) +#include +#endif + /*! \brief Atomically add v to *p and return * the previous value of *p. * This can be used to handle reference counts, and the return value * can be used to generate unique identifiers. @@@@ -606,12 +610,18 @@@@ AST_INLINE_API(int ast_atomic_fetchadd_i #elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 4) AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v), { - return OSAtomicAdd32(v, (int32_t *) p); + return OSAtomicAdd32(v, (int32_t *) p) - v; }) #elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8) AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v), { - return OSAtomicAdd64(v, (int64_t *) p); + return OSAtomicAdd64(v, (int64_t *) p) - v; +}) +#elif defined(HAVE_SYS_ATOMIC_H) +AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v), +{ + return atomic_add_int_nv((unsigned int *)p, v) - v; +}) #elif defined (__i386__) || defined(__x86_64__) AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v), { @@@@ -653,6 +663,12 @@@@ AST_INLINE_API(int ast_atomic_dec_and_te AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p), { return OSAtomicAdd64( -1, (int64_t *) p) == 0; +}) +#elif defined(HAVE_SYS_ATOMIC_H) +AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p), +{ + return atomic_dec_uint_nv((unsigned int *)p) == 0; +}) #else AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p), { @@@@ -2537,13 +2553,13 @@@@ static int ast_true(const char *s) static struct timeval tvfix(struct timeval a) { if (a.tv_usec >= ONE_MILLION) { - ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n", - (long)a.tv_sec, (long int) a.tv_usec); + ast_log(LOG_WARNING, "warning too large timestamp %jd.%ld\n", + (intmax_t)a.tv_sec, (long int) a.tv_usec); a.tv_sec += a.tv_usec / ONE_MILLION; a.tv_usec %= ONE_MILLION; } else if (a.tv_usec < 0) { - ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n", - (long)a.tv_sec, (long int) a.tv_usec); + ast_log(LOG_WARNING, "warning negative timestamp %jd.%ld\n", + (intmax_t)a.tv_sec, (long int) a.tv_usec); a.tv_usec = 0; } return a; @