From 7771bb4673d3f70163ea85c263a9c2377fcaf4ac Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 18 Mar 2009 01:16:35 +0000 Subject: [PATCH] 2009-03-18 02:16 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbatomic.h ! fixed inline assembler code for atomic inc/dec operations. It's late and I haven't wrote anything in assembler using Intel syntax for years. * reenabled inline assembler code for atomic inc/dec operations for POCC/XCC builds - such version should work. Please check. --- harbour/ChangeLog | 13 +++++++++++++ harbour/include/hbatomic.h | 8 +++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 70f0b19539..e6a9d1506a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,19 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-03-18 02:16 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbatomic.h + ! fixed inline assembler code for atomic inc/dec operations. + It's late and I haven't wrote anything in assembler using + Intel syntax for years. + * reenabled inline assembler code for atomic inc/dec operations + for POCC/XCC builds - such version should work. Please check. + +2009-03-18 01:14 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/utils/hbtest/rt_hvma.prg + * use #pragma -ko- / #pragma -ko+ to make 3 RTE messages clipper + compatible + 2009-03-18 01:04 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * include/hbatomic.h ! Typo (__inline__ -> __inline). diff --git a/harbour/include/hbatomic.h b/harbour/include/hbatomic.h index e26fd2cd47..3bf926e932 100644 --- a/harbour/include/hbatomic.h +++ b/harbour/include/hbatomic.h @@ -258,7 +258,7 @@ HB_EXTERN_BEGIN # endif /* ???CPU?? */ -#elif defined( _MSC_VER ) && ! defined( __POCC__ ) && ! defined( __XCC__ ) +#elif defined( _MSC_VER ) # if defined( i386 ) || defined( __i386__ ) || defined( __x86_64__ ) || \ defined( _M_IX86 ) || defined( _M_AMD64 ) @@ -267,14 +267,16 @@ HB_EXTERN_BEGIN static __inline void hb_atomic_inc32( volatile int * p ) { - __asm lock inc p + __asm mov eax, p + __asm lock inc dword ptr [eax] } static __inline int hb_atomic_dec32( volatile int * p ) { unsigned char c; - __asm lock dec p + __asm mov eax, p + __asm lock dec dword ptr [eax] __asm setne c return c;