I have been porting a linux application to windows platform.
Here is the linux code,
__asm__ __volatile__ ("lock; cmpxchgl %1, %2"
: "=a" (prev)
: "q" (new_value), "m" (*ptr), "0" (old_value)
: "memory");
I tried using _asm volatile but I get an error saying "inline assembler syntax error in 'opcode'; found 'data type'" in Visual studio 2012.
I need something windows equivalent code. Any info/suggestion please.