[asterisk-commits] tilghman: branch 1.4 r82028 - /branches/1.4/include/asterisk/lock.h
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Sep 8 21:35:18 CDT 2007
Author: tilghman
Date: Sat Sep 8 21:35:18 2007
New Revision: 82028
URL: http://svn.digium.com/view/asterisk?view=rev&rev=82028
Log:
Fix inline compiles on really old compilers (who uses gcc 2.7 anymore, really?)
Modified:
branches/1.4/include/asterisk/lock.h
Modified: branches/1.4/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/lock.h?view=diff&rev=82028&r1=82027&r2=82028
==============================================================================
--- branches/1.4/include/asterisk/lock.h (original)
+++ branches/1.4/include/asterisk/lock.h Sat Sep 8 21:35:18 2007
@@ -786,19 +786,27 @@
{
return OSAtomicAdd64(v, (int64_t *) p);
#elif defined (__i386__)
+#ifdef sun
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
{
__asm __volatile (
-#ifdef sun
" lock; xaddl %0, %1 ; "
-#else
- " lock xaddl %0, %1 ; "
-#endif
: "+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 ; "
+ : "+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),
{
More information about the asterisk-commits
mailing list