summaryrefslogtreecommitdiff
path: root/sal/osl
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-03-26 13:23:00 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-03-26 13:23:00 +0000
commitbd6c7a4a30652d4ac85021d0f5c4884dca429dfb (patch)
treeb96df1e5114ac6a429ddd3fbb38977a223554348 /sal/osl
parent3704d8f50d51dbd57dbb6f7d6cb3853d555cf7ae (diff)
INTEGRATION: CWS mingwport03 (1.3.142); FILE MERGED
2006/11/08 13:41:59 vg 1.3.142.2: RESYNC: (1.3-1.4); FILE MERGED 2006/09/07 11:01:29 vg 1.3.142.1: #i53572# MinGW port
Diffstat (limited to 'sal/osl')
-rw-r--r--sal/osl/w32/interlck.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/sal/osl/w32/interlck.c b/sal/osl/w32/interlck.c
index 9dc15ca6ce84..dc6ed4f4ef73 100644
--- a/sal/osl/w32/interlck.c
+++ b/sal/osl/w32/interlck.c
@@ -4,9 +4,9 @@
*
* $RCSfile: interlck.c,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: rt $ $Date: 2006-10-27 12:00:24 $
+ * last change: $Author: vg $ $Date: 2007-03-26 14:23:00 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -56,6 +56,16 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount*
#ifdef _M_IX86
#pragma warning(disable: 4035)
{
+#ifdef __MINGW32__
+ asm
+ (
+ " movl %0, %%ecx\n"
+ " movl $1, %%eax\n"
+ " lock xadd %%eax, (%%ecx)\n"
+ " incl %%eax\n"
+ ::"m"(pCount)
+ );
+#else
__asm
{
mov ecx, pCount
@@ -70,6 +80,7 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount*
cont:
inc eax
}
+#endif
}
#pragma warning(default: 4035)
#else
@@ -86,6 +97,16 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount*
#ifdef _M_IX86
#pragma warning(disable: 4035)
{
+#ifdef __MINGW32__
+ asm
+ (
+ " movl %0, %%ecx\n"
+ " movl $-1, %%eax\n"
+ " lock xadd %%eax, (%%ecx)\n"
+ " decl %%eax\n"
+ ::"m"(pCount)
+ );
+#else
__asm
{
mov ecx, pCount
@@ -100,6 +121,7 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount*
cont:
dec eax
}
+#endif
}
#pragma warning(default: 4035)
#else