* include/winnt.h (MemoryBarrier): Add definition.

This commit is contained in:
Earnie Boyd 2012-08-01 19:17:37 +00:00
parent 458e15e7d7
commit 47bc176b42
2 changed files with 17 additions and 0 deletions

View File

@ -15,6 +15,7 @@
LONG WINAPI to LONG __cdecl to match Microsoft documentation.
(InterlockedIncrement): Ditto.
(InterlockedExchange): Ditto.
* include/winnt.h (MemoryBarrier): Add definition.
2012-07-29 Earnie Boyd <earnie@users.sourceforge.net>

View File

@ -4035,6 +4035,22 @@ struct _TEB * NtCurrentTeb(void);
#endif /* __GNUC__ */
#endif /* _X86_ */
#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
# if defined(_AMD64_) || defined(__X86_64)
# define MemoryBarrier __faststorefence
# elif defined(_IA64_)
# define MemoryBarrier __mf
# else
FORCEINLINE VOID MemoryBarrier (VOID) {
LONG Barrier = 0;
__asm__ __volatile__("xchgl %%eax,%0 "
:"=r" (Barrier));
}
# endif
#else
# define MemoryBarrier
#endif
#endif /* RC_INVOKED */
#ifdef __cplusplus