Hi
I can't compile a library that employs InterlockedOr, InterlockedAnd, InterlockedOr64 and InterlockedAnd64. Following the example
found in file "atomic_x86.c" I included these lines in my library:
static long _InterlockedOr(volatile long *p, long v)
{
return (long)(*p | v);
}
static long _InterlockedAnd(volatile long *p, long v)
{
return (long)(*p & v);
}
static long _InterlockedXor(volatile long *p, long v)
{
return (long)(*p ^ v);
}
static _LONGLONG _InterlockedOr64(volatile _LONGLONG *p, _LONGLONG v)
{
return (_LONGLONG)(*p | v);
}
static _LONGLONG _InterlockedAnd64(volatile _LONGLONG *p, _LONGLONG v)
{
return (_LONGLONG)(*p & v);
}
static _LONGLONG _InterlockedXor64(volatile _LONGLONG *p, _LONGLONG v)
{
return (_LONGLONG)(*p ^ v);
}
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedXor)
#pragma intrinsic(_InterlockedOr64)
#pragma intrinsic(_InterlockedAnd64)
#pragma intrinsic(_InterlockedAnd64)
inline void MemoryBarrier(void)
{
LONG Barrier;
asm
{
xchg Barrier,eax
}
}
The library compile, but when I include the .a file in another project the result is:
[ilink64 Error] Error: Unresolved external 'InterlockedAnd' referenced from...
[ilink64 Error] Error: Unresolved external 'InterlockedAnd64' referenced from...
[ilink64 Error] Error: Unresolved external 'InterlockedOr' referenced from...
[ilink64 Error] Error: Unresolved external 'InterlockedOr64' referenced from...
How can I overcome ?
Regards