@@ -15,6 +15,7 @@ fn main() {
15
15
let linux = target. contains ( "unknown-linux" ) ;
16
16
let android = target. contains ( "android" ) ;
17
17
let apple = target. contains ( "apple" ) ;
18
+ let ios = target. contains ( "apple-ios" ) ;
18
19
let emscripten = target. contains ( "asm" ) ;
19
20
let musl = target. contains ( "musl" ) || emscripten;
20
21
let uclibc = target. contains ( "uclibc" ) ;
@@ -84,8 +85,10 @@ fn main() {
84
85
cfg. header ( "sys/socket.h" ) ;
85
86
}
86
87
cfg. header ( "net/if.h" ) ;
87
- cfg. header ( "net/route.h" ) ;
88
- cfg. header ( "net/if_arp.h" ) ;
88
+ if !ios {
89
+ cfg. header ( "net/route.h" ) ;
90
+ cfg. header ( "net/if_arp.h" ) ;
91
+ }
89
92
cfg. header ( "netdb.h" ) ;
90
93
cfg. header ( "netinet/in.h" ) ;
91
94
cfg. header ( "netinet/ip.h" ) ;
@@ -113,7 +116,7 @@ fn main() {
113
116
cfg. header ( "pwd.h" ) ;
114
117
cfg. header ( "grp.h" ) ;
115
118
cfg. header ( "sys/utsname.h" ) ;
116
- if !solaris {
119
+ if !solaris && !ios {
117
120
cfg. header ( "sys/ptrace.h" ) ;
118
121
}
119
122
cfg. header ( "sys/mount.h" ) ;
@@ -175,19 +178,22 @@ fn main() {
175
178
cfg. header ( "util.h" ) ;
176
179
cfg. header ( "xlocale.h" ) ;
177
180
cfg. header ( "sys/xattr.h" ) ;
178
- cfg. header ( "sys/sys_domain.h" ) ;
179
- cfg. header ( "net/if_utun.h" ) ;
180
- cfg. header ( "net/bpf.h" ) ;
181
181
if target. starts_with ( "x86" ) {
182
182
cfg. header ( "crt_externs.h" ) ;
183
183
}
184
- cfg. header ( "net/route.h" ) ;
185
- cfg. header ( "netinet/if_ether.h" ) ;
186
184
cfg. header ( "netinet/in.h" ) ;
187
- cfg. header ( "sys/proc_info.h" ) ;
188
- cfg. header ( "sys/kern_control.h" ) ;
189
185
cfg. header ( "sys/ipc.h" ) ;
190
186
cfg. header ( "sys/shm.h" ) ;
187
+
188
+ if !ios {
189
+ cfg. header ( "sys/sys_domain.h" ) ;
190
+ cfg. header ( "net/if_utun.h" ) ;
191
+ cfg. header ( "net/bpf.h" ) ;
192
+ cfg. header ( "net/route.h" ) ;
193
+ cfg. header ( "netinet/if_ether.h" ) ;
194
+ cfg. header ( "sys/proc_info.h" ) ;
195
+ cfg. header ( "sys/kern_control.h" ) ;
196
+ }
191
197
}
192
198
193
199
if bsdlike {
@@ -449,6 +455,17 @@ fn main() {
449
455
// header conflicts when including them with all the other structs.
450
456
"termios2" => true ,
451
457
458
+ // Present on historical versions of iOS but missing in more recent
459
+ // SDKs
460
+ "bpf_hdr" |
461
+ "proc_taskinfo" |
462
+ "proc_taskallinfo" |
463
+ "proc_bsdinfo" |
464
+ "proc_threadinfo" |
465
+ "sockaddr_inarp" |
466
+ "sockaddr_ctl" |
467
+ "arphdr" if ios => true ,
468
+
452
469
_ => false
453
470
}
454
471
} ) ;
@@ -594,6 +611,30 @@ fn main() {
594
611
// shouldn't be used in code anyway...
595
612
"AF_MAX" | "PF_MAX" => true ,
596
613
614
+ // Present on historical versions of iOS, but now removed in more
615
+ // recent SDKs
616
+ "ARPOP_REQUEST" |
617
+ "ARPOP_REPLY" |
618
+ "ATF_COM" |
619
+ "ATF_PERM" |
620
+ "ATF_PUBL" |
621
+ "ATF_USETRAILERS" |
622
+ "AF_SYS_CONTROL" |
623
+ "SYSPROTO_EVENT" |
624
+ "PROC_PIDTASKALLINFO" |
625
+ "PROC_PIDTASKINFO" |
626
+ "PROC_PIDTHREADINFO" |
627
+ "UTUN_OPT_FLAGS" |
628
+ "UTUN_OPT_IFNAME" |
629
+ "BPF_ALIGNMENT" |
630
+ "SYSPROTO_CONTROL" if ios => true ,
631
+ s if ios && s. starts_with ( "RTF_" ) => true ,
632
+ s if ios && s. starts_with ( "RTM_" ) => true ,
633
+ s if ios && s. starts_with ( "RTA_" ) => true ,
634
+ s if ios && s. starts_with ( "RTAX_" ) => true ,
635
+ s if ios && s. starts_with ( "RTV_" ) => true ,
636
+ s if ios && s. starts_with ( "DLT_" ) => true ,
637
+
597
638
_ => false ,
598
639
}
599
640
} ) ;
@@ -736,6 +777,10 @@ fn main() {
736
777
// FIXME: mincore is defined with caddr_t on Solaris.
737
778
"mincore" if solaris => true ,
738
779
780
+ // These were all included in historical versions of iOS but appear
781
+ // to be removed now
782
+ "system" | "ptrace" if ios => true ,
783
+
739
784
_ => false ,
740
785
}
741
786
} ) ;
0 commit comments