[LLVMdev] RFC: Atomics.h

Owen Anderson resistor at mac.com
Fri May 29 00:41:19 CDT 2009


On May 28, 2009, at 6:03 PM, Jonathan Ragan-Kelley wrote:

> In the current trunk, System/Atomic.[h,cpp] define void
> llvm::sys::MemoryFence(). This conflicts with the MemoryFence macro in
> <windows.h> and (since it's a preprocessor macro, and not a scoped
> function definition) causes the sys::MemoryFence definition on
> Atomic.cpp:23 to explode, as it's nonsensically expanded to a cl
> intrinsic (_mm_mfence). This breaks the Visual Studio build.
>
> The trivial fix is to #undef MemoryFence immediately after including
> <windows.h>, since it's clearly assumed not to exist. A deeper and
> safer fix might consider avoiding a name conflict with a core system
> macro on a widely used platform.

Wait, it defines MemoryFence() AND MemoryBarrier()??

Sheesh, they had to take all the reasonable names.  :-/

--Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2620 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20090528/8202b1f7/attachment.bin 


More information about the LLVMdev mailing list