summaryrefslogtreecommitdiff
path: root/utils/extconf.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2008-01-08 15:26:50 +0000
committerJoshua Colp <jcolp@digium.com>2008-01-08 15:26:50 +0000
commit9c0c82d0d01b0a0d17c2f2e494ff3c83bc3bbd3d (patch)
tree71664f8ce42d160ff05047d33512cfb1884f605b /utils/extconf.c
parentafe68c232395ecf67d6ad54dab302ef2ccd187b9 (diff)
Make ast_atomic_fetchadd_int_slow magically appear in extconf.
(closes issue #11703) Reported by: dmartin git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'utils/extconf.c')
-rw-r--r--utils/extconf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/extconf.c b/utils/extconf.c
index a64258cd9..c5b9fbdea 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -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);