aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/lock.h
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-09 02:45:06 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-09 02:45:06 +0000
commit4c751dd454a16dd258a4b5a49586b006bc9f729c (patch)
treed56557a27502ef609f0663d8c768dd2f0cb835b5 /include/asterisk/lock.h
parent9458303d9f1856f8c3605d2df51e977b96871c63 (diff)
Merged revisions 82028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82028 | tilghman | 2007-09-08 21:35:18 -0500 (Sat, 08 Sep 2007) | 2 lines Fix inline compiles on really old compilers (who uses gcc 2.7 anymore, really?) (closes issue #10675) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82029 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/lock.h')
-rw-r--r--include/asterisk/lock.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index 22c7ef1ca..686f36685 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -786,19 +786,27 @@ AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
{
return OSAtomicAdd64(v, (int64_t *) p);
#elif defined (__i386__) || defined(__x86_64__)
+#ifdef sun
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
{
__asm __volatile (
-#ifdef sun
" lock; xaddl %0, %1 ; "
-#else
+ : "+r" (v), /* 0 (result) */
+ "=m" (*p) /* 1 */
+ : "m" (*p)); /* 2 */
+ return (v);
+})
+#else /* ifndef sun */
+AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
+{
+ __asm __volatile (
" lock xaddl %0, %1 ; "
-#endif
: "+r" (v), /* 0 (result) */
"=m" (*p) /* 1 */
: "m" (*p)); /* 2 */
return (v);
})
+#endif
#else /* low performance version in utils.c */
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
{