From 9311aa648374734cd95e5a624b66ccfc7992cf64 Mon Sep 17 00:00:00 2001 From: hongxu-jia Date: Wed, 1 Aug 2018 14:10:26 +0800 Subject: [PATCH] fix compile failed with libc musl (#103) There is a failure while compiling with libc musl: [snip] |./block-cache/io_engine.h:18:17: error: expected unqualified-id before numeric constant | unsigned const PAGE_SIZE = 4096; [snip] The musl defeines macro PAGE_SIZE, undef it conditionally could fix the issue. http://musl.openwall.narkive.com/tO8vrHdP/why-musl-define-page-size Signed-off-by: Hongxu Jia --- block-cache/io_engine.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block-cache/io_engine.h b/block-cache/io_engine.h index 0e13957..5998ffb 100644 --- a/block-cache/io_engine.h +++ b/block-cache/io_engine.h @@ -17,6 +17,10 @@ //---------------------------------------------------------------- +// Musl defines +#ifdef PAGE_SIZE +#undef PAGE_SIZE +#endif namespace bcache { using sector_t = uint64_t;