dect
/
asterisk
Archived
13
0
Fork 0

Make ast_atomic_fetchadd_int_slow magically appear in extconf.

(closes issue #11703)
Reported by: dmartin


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97041 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
file 2008-01-08 15:26:50 +00:00
parent 360dff1573
commit d2509a4bb7
1 changed files with 8 additions and 3 deletions

View File

@ -1756,8 +1756,6 @@ static void __attribute__ ((destructor)) fini_##rwlock(void) \
* as ast_atomic_fetchadd_int_slow()
*/
int ast_atomic_fetchadd_int_slow(volatile int *p, int v);
#if defined(HAVE_OSX_ATOMICS)
#include "libkern/OSAtomic.h"
#endif
@ -1791,7 +1789,14 @@ AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
: "m" (*p)); /* 2 */
return (v);
})
#else /* low performance version in utils.c */
#else
static int ast_atomic_fetchadd_int_slow(volatile int *p, int v)
{
int ret;
ret = *p;
*p += v;
return ret;
}
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
{
return ast_atomic_fetchadd_int_slow(p, v);