X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/fbe202f33ba6acc3421fc811c33892d160ae722e..b4d8c89302c67237b8a121a8f262e9db0022a9e7:/lib/base/object.h diff --git a/lib/base/object.h b/lib/base/object.h index 8ac92b83..1723a885 100644 --- a/lib/base/object.h +++ b/lib/base/object.h @@ -140,7 +140,7 @@ public: if (!ref) \ delete this; \ } - #elif defined(__i386__) + #elif defined(__i386__) || defined(__x86_64__) #define DECLARE_REF(x) \ private: oRefCount ref; \ public: void AddRef(); \ @@ -149,16 +149,16 @@ public: void c::AddRef() \ { \ __asm__ __volatile__( \ - " incl %0 \n" \ + " lock ; incl %0 \n" \ : "=m" (ref.count) \ - : "m" (ref.count); \ + : "m" (ref.count)); \ } \ void c::Release() \ { \ __asm__ __volatile__( \ - " decl %0 \n" \ + " lock ; decl %0 \n" \ : "=m" (ref.count) \ - : "m" (ref.count); \ + : "m" (ref.count)); \ if (!ref) \ delete this; \ }