File tree 6 files changed +22
-10
lines changed
6 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,13 @@ LOCAL_STATIC_LIBRARIES := \
38
38
$(common_static_libraries )
39
39
include $(BUILD_STATIC_LIBRARY )
40
40
41
- ifeq ($(HOST_OS ) ,linux)
42
-
43
41
include $(CLEAR_VARS )
44
42
LOCAL_CFLAGS := $(common_cflags ) -D_GNU_SOURCE -DFEC_NO_KLOG
45
43
LOCAL_C_INCLUDES := $(common_c_includes )
46
44
LOCAL_CLANG := true
45
+ ifeq ($(HOST_OS ) ,linux)
47
46
LOCAL_SANITIZE := integer
47
+ endif
48
48
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH ) /include
49
49
LOCAL_MODULE := libfec_host
50
50
LOCAL_SRC_FILES := $(common_src_files )
@@ -55,6 +55,4 @@ LOCAL_STATIC_LIBRARIES := \
55
55
$(common_static_libraries )
56
56
include $(BUILD_HOST_STATIC_LIBRARY )
57
57
58
- endif # HOST_OS == linux
59
-
60
58
include $(LOCAL_PATH ) /test/Android.mk
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- #include < linux/fs.h>
18
17
#include < stdlib.h>
19
18
#include < sys/ioctl.h>
20
19
#include < sys/stat.h>
@@ -24,6 +23,14 @@ extern "C" {
24
23
#include < ext4_sb.h>
25
24
}
26
25
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
+
27
34
#include " fec_private.h"
28
35
29
36
/* used by `find_offset'; returns metadata size for a file size `size' and
Original file line number Diff line number Diff line change 31
31
#include < unordered_map>
32
32
#include < vector>
33
33
34
+ #include < utils/Compat.h>
34
35
#include < mincrypt/rsa.h>
35
36
#include < openssl/sha.h>
36
37
#include < fec/io.h>
Original file line number Diff line number Diff line change 1
1
LOCAL_PATH: = $(call my-dir)
2
2
3
- ifeq ($(HOST_OS ) ,linux)
4
-
5
3
include $(CLEAR_VARS )
6
4
LOCAL_CLANG := true
5
+ ifeq ($(HOST_OS ) ,linux)
7
6
LOCAL_SANITIZE := integer
7
+ endif
8
8
LOCAL_MODULE := fec
9
9
LOCAL_SRC_FILES := main.cpp image.cpp
10
10
LOCAL_MODULE_TAGS := optional
@@ -21,8 +21,6 @@ LOCAL_CFLAGS += -Wall -Werror -O3
21
21
LOCAL_C_INCLUDES += external/fec
22
22
include $(BUILD_HOST_EXECUTABLE )
23
23
24
- endif # HOST_OS == linux
25
-
26
24
include $(CLEAR_VARS )
27
25
LOCAL_CLANG := true
28
26
LOCAL_SANITIZE := integer
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ extern "C" {
26
26
#include < errno.h>
27
27
#include < fcntl.h>
28
28
#include < getopt.h>
29
- #include < linux/fs.h>
30
29
#include < openssl/sha.h>
31
30
#include < pthread.h>
32
31
#include < stdbool.h>
@@ -39,6 +38,14 @@ extern "C" {
39
38
#endif
40
39
#include " image.h"
41
40
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
+
42
49
void image_init (image *ctx)
43
50
{
44
51
memset (ctx, 0 , sizeof (*ctx));
Original file line number Diff line number Diff line change 17
17
#ifndef __FEC_H__
18
18
#define __FEC_H__
19
19
20
+ #include <utils/Compat.h>
20
21
#include <fec/io.h>
21
22
#include <fec/ecc.h>
22
23
You can’t perform that action at this time.
0 commit comments