From ef20f6380813110434dae416f0abe964e476c8c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Thu, 9 Nov 2017 19:55:39 -0800 Subject: [PATCH] folly: fix sysMembarrier() with newer kernel headers 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 --- folly/portability/SysMembarrier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/folly/portability/SysMembarrier.cpp b/folly/portability/SysMembarrier.cpp index ba1774da..9b3735c9 100644 --- a/folly/portability/SysMembarrier.cpp +++ b/folly/portability/SysMembarrier.cpp @@ -26,10 +26,12 @@ #define FOLLY_USE_SYS_MEMBARRIER 1 #if !defined(__NR_membarrier) #define __NR_membarrier 324 +#endif +#if FOLLY_HAVE_LINUX_MEMBARRIER_H +#include // @manual +#else #define MEMBARRIER_CMD_QUERY 0 #define MEMBARRIER_CMD_SHARED 1 -#elif FOLLY_HAVE_LINUX_MEMBARRIER_H -#include // @manual #endif #endif -- 2.34.1