]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix inline compiles on really old compilers (who uses gcc 2.7 anymore, really?)
authorTilghman Lesher <tilghman@meg.abyt.es>
Sun, 9 Sep 2007 02:35:18 +0000 (02:35 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sun, 9 Sep 2007 02:35:18 +0000 (02:35 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82028 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/lock.h

index eea145acf083d61ba01d1b7fee87dbe34b2b9e64..b8eeeb33cf1ad4ac8b5875cdef3c6fe29fce752b 100644 (file)
@@ -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__)
+#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),
 {