File tree Expand file tree Collapse file tree 6 files changed +22
-10
lines changed
Expand file tree Collapse file tree 6 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,13 @@ LOCAL_STATIC_LIBRARIES := \
3838 $(common_static_libraries )
3939include $(BUILD_STATIC_LIBRARY )
4040
41- ifeq ($(HOST_OS ) ,linux)
42-
4341include $(CLEAR_VARS )
4442LOCAL_CFLAGS := $(common_cflags ) -D_GNU_SOURCE -DFEC_NO_KLOG
4543LOCAL_C_INCLUDES := $(common_c_includes )
4644LOCAL_CLANG := true
45+ ifeq ($(HOST_OS ) ,linux)
4746LOCAL_SANITIZE := integer
47+ endif
4848LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH ) /include
4949LOCAL_MODULE := libfec_host
5050LOCAL_SRC_FILES := $(common_src_files )
@@ -55,6 +55,4 @@ LOCAL_STATIC_LIBRARIES := \
5555 $(common_static_libraries )
5656include $(BUILD_HOST_STATIC_LIBRARY )
5757
58- endif # HOST_OS == linux
59-
6058include $(LOCAL_PATH ) /test/Android.mk
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17- #include < linux/fs.h>
1817#include < stdlib.h>
1918#include < sys/ioctl.h>
2019#include < sys/stat.h>
@@ -24,6 +23,14 @@ extern "C" {
2423 #include < ext4_sb.h>
2524}
2625
26+ #if defined(__linux__)
27+ #include < linux/fs.h>
28+ #elif defined(__APPLE__)
29+ #include < sys/disk.h>
30+ #define BLKGETSIZE64 DKIOCGETBLOCKCOUNT
31+ #define fdatasync (fd ) fcntl((fd), F_FULLFSYNC)
32+ #endif
33+
2734#include " fec_private.h"
2835
2936/* used by `find_offset'; returns metadata size for a file size `size' and
Original file line number Diff line number Diff line change 3131#include < unordered_map>
3232#include < vector>
3333
34+ #include < utils/Compat.h>
3435#include < mincrypt/rsa.h>
3536#include < openssl/sha.h>
3637#include < fec/io.h>
Original file line number Diff line number Diff line change 11LOCAL_PATH: = $(call my-dir)
22
3- ifeq ($(HOST_OS ) ,linux)
4-
53include $(CLEAR_VARS )
64LOCAL_CLANG := true
5+ ifeq ($(HOST_OS ) ,linux)
76LOCAL_SANITIZE := integer
7+ endif
88LOCAL_MODULE := fec
99LOCAL_SRC_FILES := main.cpp image.cpp
1010LOCAL_MODULE_TAGS := optional
@@ -21,8 +21,6 @@ LOCAL_CFLAGS += -Wall -Werror -O3
2121LOCAL_C_INCLUDES += external/fec
2222include $(BUILD_HOST_EXECUTABLE )
2323
24- endif # HOST_OS == linux
25-
2624include $(CLEAR_VARS )
2725LOCAL_CLANG := true
2826LOCAL_SANITIZE := integer
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ extern "C" {
2626#include < errno.h>
2727#include < fcntl.h>
2828#include < getopt.h>
29- #include < linux/fs.h>
3029#include < openssl/sha.h>
3130#include < pthread.h>
3231#include < stdbool.h>
@@ -39,6 +38,14 @@ extern "C" {
3938#endif
4039#include " image.h"
4140
41+ #if defined(__linux__)
42+ #include < linux/fs.h>
43+ #elif defined(__APPLE__)
44+ #include < sys/disk.h>
45+ #define BLKGETSIZE64 DKIOCGETBLOCKCOUNT
46+ #define O_LARGEFILE 0
47+ #endif
48+
4249void image_init (image *ctx)
4350{
4451 memset (ctx, 0 , sizeof (*ctx));
Original file line number Diff line number Diff line change 1717#ifndef __FEC_H__
1818#define __FEC_H__
1919
20+ #include <utils/Compat.h>
2021#include <fec/io.h>
2122#include <fec/ecc.h>
2223
You can’t perform that action at this time.
0 commit comments