diff --git a/reactos/include/ddk/wdm.h b/reactos/include/ddk/wdm.h index d70b8cf9ea7..1f82d9e8dfd 100644 --- a/reactos/include/ddk/wdm.h +++ b/reactos/include/ddk/wdm.h @@ -7713,7 +7713,9 @@ FORCEINLINE VOID KeMemoryBarrier(VOID) { - volatile LONG Barrier; + LONG Barrier, *Dummy = &Barrier; + UNREFERENCED_LOCAL_VARIABLE(Dummy); + #if defined(__GNUC__) __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax"); #elif defined(_MSC_VER) diff --git a/reactos/include/psdk/windef.h b/reactos/include/psdk/windef.h index 1fa768b2ecd..d1ca30f75e5 100644 --- a/reactos/include/psdk/windef.h +++ b/reactos/include/psdk/windef.h @@ -417,11 +417,6 @@ typedef struct _FILETIME { # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type; #endif -#define UNREFERENCED_PARAMETER(P) {(P)=(P);} -#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);} -#define DBG_UNREFERENCED_PARAMETER(P) -#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) - #ifndef __WATCOMC__ #ifndef _export #define _export diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 10e82d04e1a..94a5602208d 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -66,6 +66,10 @@ #endif #endif /* __ANONYMOUS_DEFINED */ +#define UNREFERENCED_PARAMETER(P) {(P)=(P);} +#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);} +#define DBG_UNREFERENCED_PARAMETER(P) +#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) #ifndef DECLSPEC_ALIGN # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) @@ -5251,7 +5255,8 @@ FORCEINLINE VOID MemoryBarrier(VOID) { - LONG Barrier; + LONG Barrier, *Dummy = &Barrier; + UNREFERENCED_LOCAL_VARIABLE(Dummy); __asm__ __volatile__("xchgl %%eax, %[Barrier]" : : [Barrier] "m" (Barrier) : "memory"); } #endif diff --git a/reactos/include/xdk/x86/ke.h b/reactos/include/xdk/x86/ke.h index 003d560044a..87e66b32ca8 100644 --- a/reactos/include/xdk/x86/ke.h +++ b/reactos/include/xdk/x86/ke.h @@ -51,7 +51,9 @@ FORCEINLINE VOID KeMemoryBarrier(VOID) { - volatile LONG Barrier; + LONG Barrier, *Dummy = &Barrier; + UNREFERENCED_LOCAL_VARIABLE(Dummy); + #if defined(__GNUC__) __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax"); #elif defined(_MSC_VER)