_InterlockedOr8 is an intrinsic compiler function unique to the Microsoft compiler - meaning that the compiler automatically inlines an implementation into the code instead of linking with a library. <intr.h>
is a header file distributed with Visual Studio, separate from the Windows SDK.
If you can't switch to Visual Studio (free download, btw), then you could define your own replacement version of this function:
void InterlockedOr8(char* dst, char src)
{
__asm
{
mov eax, dst ; EAX = dst
mov cl, src ; ECX = src
lock or [eax], cl ; *dst = src | *dst; // this is the actual interlocked-or op
}
}
Notice that this function differs from _InterlockedOr8 in the fact that it doesn't return the original value of *dst. The implementation gets a more complicated if you need the return value. I took a quick look at SyncSys source. The two places that need that function don't need the return value. So all you have to do is convert the above code to use the gcc style of inline assembly.
Update
Here's a version that correctly returns the original value within the destination address before the OR operation. It could probably use a little code review scrutiny...
char MyInterlockedOr8(char* dst, char src)
{
char result = 0;
const size_t ptr_size = sizeof(dst);
_asm
{
mov esi, dst ; esi = dst
mov cl, src ; cl = src // keep "src" cached in a register
mov al, [esi] ; al = *dst
start:
mov bl, cl ; bl = src
or bl, al ; bl = src | *dst
lock cmpxchg [esi], bl; // if (*dst == eax) { *dst=bl ;} else {al = *dst};
jne start
mov result, al ; result = al
}
return result;
}