You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2017/04/20 17:35:28 UTC
[6/7] bookkeeper git commit: Address the compilation issue on mac
Address the compilation issue on mac
Project: http://git-wip-us.apache.org/repos/asf/bookkeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/bookkeeper/commit/49081aeb
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/49081aeb
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/49081aeb
Branch: refs/heads/sijie/bookkeeper_fallocate
Commit: 49081aebea8437bfbcc18c85aea7c99080427068
Parents: 74113b5
Author: Sijie Guo <si...@apache.org>
Authored: Thu Apr 20 10:31:11 2017 -0700
Committer: Sijie Guo <si...@apache.org>
Committed: Thu Apr 20 10:31:11 2017 -0700
----------------------------------------------------------------------
.../main/native/src/org/apache/bookkeeper/util/NativeIO.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/49081aeb/bookkeeper-server/src/main/native/src/org/apache/bookkeeper/util/NativeIO.c
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/main/native/src/org/apache/bookkeeper/util/NativeIO.c b/bookkeeper-server/src/main/native/src/org/apache/bookkeeper/util/NativeIO.c
index 9ba2854..789f10f 100644
--- a/bookkeeper-server/src/main/native/src/org/apache/bookkeeper/util/NativeIO.c
+++ b/bookkeeper-server/src/main/native/src/org/apache/bookkeeper/util/NativeIO.c
@@ -22,9 +22,17 @@
#include <fcntl.h>
#include <sys/syscall.h>
#include <sys/types.h>
-#include <asm-x86_64/unistd.h>
+#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
+ /* UNIX-style OS. ------------------------------------------- */
+ #include <unistd.h>
+ #if (defined(__unit__) || defined(__unix)) && defined(__x86_64__)
+ #include <asm-x86_64/unistd.h>
+ #endif
+#endif
#include "config.h"
+
+
#if defined(HAVE_FALLOCATE)
# define my_fallocate fallocate
#elif defined(__NR_fallocate)