gcc and clang use asm volatile ("":::"memory") to indicate a compiler fence.
Sun Studio 12u1 adds support for asm volatile ("":::"memory") as compiler fence.
Unless otherwise noted (xlC and MSVC), it is likely that asm volatile ("":::"memory") will act as a compiler fence or, at worst will be a no-op.  If you would like, I can add a comment about the compilers that currently support the asm volatile ("":::"memory") idiom to indicate a compiler fence.