Summary:
When __NR_membarrier is defined (on newer kernels),
we don't define the constants, but also by default
don't include the membarrier header to define the necessary constants.
Therefore split the definition of the syscall value and
the constants used with it, to ensure both are defined.
Reviewed By: yfeldblum
Differential Revision:
D6292178
fbshipit-source-id:
31ba9d4a698a4f5e14ae34de0acf8f851d75527d
#define FOLLY_USE_SYS_MEMBARRIER 1
#if !defined(__NR_membarrier)
#define __NR_membarrier 324
+#endif
+#if FOLLY_HAVE_LINUX_MEMBARRIER_H
+#include <linux/membarrier.h> // @manual
+#else
#define MEMBARRIER_CMD_QUERY 0
#define MEMBARRIER_CMD_SHARED 1
-#elif FOLLY_HAVE_LINUX_MEMBARRIER_H
-#include <linux/membarrier.h> // @manual
#endif
#endif