main: Undefine MemoryBarrier for Windows

In winnt.h, MemoryBarrier can be defined in one of 4 ways, depending
on which architecture is being targeted.
- For x86, it's an inline function.
- For x64, it's an object-like macro, which means that the MemoryBarrier
  function in the table actually ends up being called __faststorefence.
- For arm and arm64, it's a function-like macro, and the preprocessor fails
  because the function table entry doesn't call it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8485>
This commit is contained in:
Jesse Natalie 2021-01-13 14:42:08 -08:00
parent 0e1447eb1b
commit 86b4f6ad43

View file

@ -36,6 +36,14 @@
#include "menums.h"
#include "compiler/shader_enums.h"
/* Windows winnt.h defines MemoryBarrier as a macro on some platforms,
* including as a function-like macro in some cases. That either causes
* the table entry below to have a weird name, or fail to compile.
*/
#ifdef MemoryBarrier
#undef MemoryBarrier
#endif
struct gl_bitmap_atlas;
struct gl_buffer_object;
struct gl_context;