diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2015-09-28 17:05:11 +0100 |
---|---|---|
committer | Sami Tolvanen <samitolvanen@google.com> | 2015-09-29 13:27:30 +0100 |
commit | 0403024cd6763fff3a0118b15e68c0f7fe4766d5 (patch) | |
tree | 23743430e125723a3017f67d8e79542cebdc806d /verity | |
parent | 3625af964efa97cc7163f88ff711e67fab57af23 (diff) | |
download | extras-0403024cd6763fff3a0118b15e68c0f7fe4766d5.tar.gz |
fec: enable building on Mac
Enable the host libfec and the fec tool to be built on Mac with the
help of <utils/Compat.h>.
Change-Id: I5e7c9fac11f4a00814bad92734e703ec8dc22dc9
Diffstat (limited to 'verity')
-rw-r--r-- | verity/fec/Android.mk | 6 | ||||
-rw-r--r-- | verity/fec/image.cpp | 9 | ||||
-rw-r--r-- | verity/fec/image.h | 1 |
3 files changed, 11 insertions, 5 deletions
diff --git a/verity/fec/Android.mk b/verity/fec/Android.mk index 774878d4..c13f5775 100644 --- a/verity/fec/Android.mk +++ b/verity/fec/Android.mk @@ -1,10 +1,10 @@ LOCAL_PATH:= $(call my-dir) -ifeq ($(HOST_OS),linux) - include $(CLEAR_VARS) LOCAL_CLANG := true +ifeq ($(HOST_OS),linux) LOCAL_SANITIZE := integer +endif LOCAL_MODULE := fec LOCAL_SRC_FILES := main.cpp image.cpp LOCAL_MODULE_TAGS := optional @@ -21,8 +21,6 @@ LOCAL_CFLAGS += -Wall -Werror -O3 LOCAL_C_INCLUDES += external/fec include $(BUILD_HOST_EXECUTABLE) -endif # HOST_OS == linux - include $(CLEAR_VARS) LOCAL_CLANG := true LOCAL_SANITIZE := integer diff --git a/verity/fec/image.cpp b/verity/fec/image.cpp index 7acf4c87..41018158 100644 --- a/verity/fec/image.cpp +++ b/verity/fec/image.cpp @@ -26,7 +26,6 @@ extern "C" { #include <errno.h> #include <fcntl.h> #include <getopt.h> -#include <linux/fs.h> #include <openssl/sha.h> #include <pthread.h> #include <stdbool.h> @@ -39,6 +38,14 @@ extern "C" { #endif #include "image.h" +#if defined(__linux__) + #include <linux/fs.h> +#elif defined(__APPLE__) + #include <sys/disk.h> + #define BLKGETSIZE64 DKIOCGETBLOCKCOUNT + #define O_LARGEFILE 0 +#endif + void image_init(image *ctx) { memset(ctx, 0, sizeof(*ctx)); diff --git a/verity/fec/image.h b/verity/fec/image.h index a7f55530..f235eb58 100644 --- a/verity/fec/image.h +++ b/verity/fec/image.h @@ -17,6 +17,7 @@ #ifndef __FEC_H__ #define __FEC_H__ +#include <utils/Compat.h> #include <fec/io.h> #include <fec/ecc.h> |