Skip to content

Commit fc603ff

Browse files
hpux735das
authored andcommitted
Fix building on armv7
Signed-off-by: Daniel A. Steffen <[email protected]>
1 parent b04860b commit fc603ff

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

configure.ac

+6
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ AC_ARG_WITH([swift-toolchain],
147147
case $target_os in
148148
linux*)
149149
os_string="linux"
150+
case $target_cpu in
151+
armv7l*)
152+
target_cpu="armv7"
153+
;;
154+
*)
155+
esac
150156
;;
151157
*)
152158
os_string=$target_os

dispatch/dispatch.h

+2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@
4949

5050
#if defined(__linux__) && defined(__has_feature)
5151
#if __has_feature(modules)
52+
#if !defined(__arm__)
5253
#include <stdio.h> // for off_t (to match Glibc.modulemap)
5354
#endif
5455
#endif
56+
#endif
5557

5658
#define DISPATCH_API_VERSION 20160712
5759

src/io.c

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
#define DISPATCH_IO_DEBUG DISPATCH_DEBUG
2525
#endif
2626

27+
#ifndef PAGE_SIZE
28+
#define PAGE_SIZE getpagesize()
29+
#endif
30+
2731
#if DISPATCH_DATA_IS_BRIDGED_TO_NSDATA
2832
#define _dispatch_io_data_retain(x) _dispatch_objc_retain(x)
2933
#define _dispatch_io_data_release(x) _dispatch_objc_release(x)

0 commit comments

Comments
 (0)