projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
folly: fix sysMembarrier() with newer kernel headers
[folly.git]
/
folly
/
portability
/
SysMembarrier.cpp
diff --git
a/folly/portability/SysMembarrier.cpp
b/folly/portability/SysMembarrier.cpp
index a0d0d90afa201d2423b77aa09ee3c7432a7353bb..9b3735c965603e8cbfa985aa7f4566522191b820 100644
(file)
--- a/
folly/portability/SysMembarrier.cpp
+++ b/
folly/portability/SysMembarrier.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
6
Facebook, Inc.
+ * Copyright 201
7
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-26,10
+26,12
@@
#define FOLLY_USE_SYS_MEMBARRIER 1
#if !defined(__NR_membarrier)
#define __NR_membarrier 324
#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
#define MEMBARRIER_CMD_QUERY 0
#define MEMBARRIER_CMD_SHARED 1
-#elif FOLLY_HAVE_LINUX_MEMBARRIER_H
-#include <linux/membarrier.h>
#endif
#endif
#endif
#endif
@@
-60,5
+62,5
@@
int sysMembarrier() {
return -1;
#endif
}
return -1;
#endif
}
-}
-}
+}
// namespace detail
+}
// namespace folly