• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #define __INTRINSIC_ONLYSPECIAL
2 #define __INTRINSIC_SPECIAL__InterlockedOr64 /* Causes code generation in intrin-impl.h */
3 
4 #include <intrin.h>
5 
6 #ifdef _WIN64
7 #else
8 __int64 __stdcall InterlockedCompareExchange64(__int64 volatile *Destination,
9   __int64 Exchange, __int64 Comperand);
10 __int64 _InterlockedOr64 (__int64 volatile *Destination,__int64 Value);
_InterlockedOr64(__int64 volatile * Destination,__int64 Value)11 __int64 _InterlockedOr64 (__int64 volatile *Destination,__int64 Value)
12 {
13   __int64 Old;
14   do {
15     Old = *Destination;
16   } while(InterlockedCompareExchange64(Destination,Old | Value,Old)!=Old);
17   return Old;
18 }
19 #endif
20 
21 #ifdef _WIN64
22 __int64 InterlockedOr64(__int64 volatile *, __int64) __attribute__((alias("_InterlockedOr64")));
23 #else
24 __int64 __stdcall InterlockedOr64(__int64 volatile *Destination, __int64 Value);
InterlockedOr64(__int64 volatile * Destination,__int64 Value)25 __int64 __stdcall InterlockedOr64(__int64 volatile *Destination, __int64 Value)
26 {
27   return _InterlockedOr64(Destination, Value);
28 }
29 #endif
30 
31