File tree 8 files changed +55
-12
lines changed
8 files changed +55
-12
lines changed Original file line number Diff line number Diff line change 7
7
8
8
run () {
9
9
echo " Building docker container for target ${1} "
10
+
10
11
# use -f so we can use ci/ as build context
11
12
docker build -t libc -f " ci/docker/${1} /Dockerfile" ci/
12
13
mkdir -p target
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ fn main() {
26
26
let openbsd = target. contains ( "openbsd" ) ;
27
27
let rumprun = target. contains ( "rumprun" ) ;
28
28
let solaris = target. contains ( "solaris" ) ;
29
+ let cloudabi = target. contains ( "cloudabi" ) ;
30
+ let redox = target. contains ( "redox" ) ;
29
31
let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly;
30
32
let mut cfg = ctest:: TestGenerator :: new ( ) ;
31
33
@@ -42,6 +44,8 @@ fn main() {
42
44
cfg. define ( "_XOPEN_SOURCE" , Some ( "700" ) ) ;
43
45
cfg. define ( "__EXTENSIONS__" , None ) ;
44
46
cfg. define ( "_LCONV_C99" , None ) ;
47
+ } else if freebsd {
48
+ cfg. define ( "_WITH_GETLINE" , None ) ;
45
49
}
46
50
47
51
// Android doesn't actually have in_port_t but it's much easier if we
@@ -351,6 +355,10 @@ fn main() {
351
355
}
352
356
}
353
357
358
+ if cloudabi || redox {
359
+ cfg. header ( "strings.h" ) ;
360
+ }
361
+
354
362
cfg. type_name ( move |ty, is_struct, is_union| {
355
363
match ty {
356
364
// Just pass all these through, no need for a "struct" prefix
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ extern {
185
185
pub fn atexit ( cb : extern fn ( ) ) -> c_int ;
186
186
pub fn system ( s : * const c_char ) -> c_int ;
187
187
pub fn getenv ( s : * const c_char ) -> * mut c_char ;
188
+ pub fn getline ( lineptr : * mut * mut c_char , n : * mut size_t ,
189
+ stream : * mut FILE ) -> ssize_t ;
188
190
189
191
pub fn strcpy ( dst : * mut c_char , src : * const c_char ) -> * mut c_char ;
190
192
pub fn strncpy ( dst : * mut c_char , src : * const c_char ,
@@ -201,6 +203,9 @@ extern {
201
203
pub fn strdup ( cs : * const c_char ) -> * mut c_char ;
202
204
pub fn strpbrk ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
203
205
pub fn strstr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
206
+ pub fn strcasecmp ( s1 : * const c_char , s2 : * const c_char ) -> c_int ;
207
+ pub fn strncasecmp ( s1 : * const c_char , s2 : * const c_char ,
208
+ n : size_t ) -> c_int ;
204
209
pub fn strlen ( cs : * const c_char ) -> size_t ;
205
210
pub fn strnlen ( cs : * const c_char , maxlen : size_t ) -> size_t ;
206
211
pub fn strerror ( n : c_int ) -> * mut c_char ;
Original file line number Diff line number Diff line change @@ -231,6 +231,10 @@ extern {
231
231
pub fn strdup ( cs : * const c_char ) -> * mut c_char ;
232
232
pub fn strpbrk ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
233
233
pub fn strstr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
234
+ pub fn strcasestr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
235
+ pub fn strcasecmp ( s1 : * const c_char , s2 : * const c_char ) -> c_int ;
236
+ pub fn strncasecmp ( s1 : * const c_char , s2 : * const c_char ,
237
+ n : size_t ) -> c_int ;
234
238
pub fn strlen ( cs : * const c_char ) -> size_t ;
235
239
pub fn strnlen ( cs : * const c_char , maxlen : size_t ) -> size_t ;
236
240
pub fn strerror ( n : c_int ) -> * mut c_char ;
Original file line number Diff line number Diff line change @@ -476,6 +476,9 @@ extern {
476
476
pub fn strdup ( cs : * const c_char ) -> * mut c_char ;
477
477
pub fn strpbrk ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
478
478
pub fn strstr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
479
+ pub fn strcasecmp ( s1 : * const c_char , s2 : * const c_char ) -> c_int ;
480
+ pub fn strncasecmp ( s1 : * const c_char , s2 : * const c_char ,
481
+ n : size_t ) -> c_int ;
479
482
pub fn strlen ( cs : * const c_char ) -> size_t ;
480
483
pub fn strnlen ( cs : * const c_char , maxlen : size_t ) -> size_t ;
481
484
#[ cfg_attr(
@@ -1108,6 +1111,10 @@ extern {
1108
1111
pub fn posix_openpt ( flags : :: c_int ) -> :: c_int ;
1109
1112
pub fn ptsname ( fd : :: c_int ) -> * mut :: c_char ;
1110
1113
pub fn unlockpt ( fd : :: c_int ) -> :: c_int ;
1114
+
1115
+ pub fn strcasestr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
1116
+ pub fn getline ( lineptr : * mut * mut c_char , n : * mut size_t ,
1117
+ stream : * mut FILE ) -> ssize_t ;
1111
1118
}
1112
1119
1113
1120
cfg_if ! {
Original file line number Diff line number Diff line change
1
+ pub const L_tmpnam : :: c_uint = 14 ;
2
+ pub const TMP_MAX : :: c_uint = 0x7fff ;
3
+
4
+ extern {
5
+ pub fn strcasecmp ( s1 : * const :: c_char , s2 : * const :: c_char ) -> :: c_int ;
6
+ pub fn strncasecmp ( s1 : * const :: c_char , s2 : * const :: c_char ,
7
+ n : :: size_t ) -> :: c_int ;
8
+ }
Original file line number Diff line number Diff line change @@ -111,18 +111,6 @@ pub const BUFSIZ: ::c_uint = 512;
111
111
pub const FOPEN_MAX : :: c_uint = 20 ;
112
112
pub const FILENAME_MAX : :: c_uint = 260 ;
113
113
114
- cfg_if ! {
115
- if #[ cfg( all( target_env = "gnu" ) ) ] {
116
- pub const L_tmpnam : :: c_uint = 14 ;
117
- pub const TMP_MAX : :: c_uint = 0x7fff ;
118
- } else if #[ cfg( all( target_env = "msvc" ) ) ] {
119
- pub const L_tmpnam : :: c_uint = 260 ;
120
- pub const TMP_MAX : :: c_uint = 0x7fff_ffff ;
121
- } else {
122
- // Unknown target_env
123
- }
124
- }
125
-
126
114
pub const O_RDONLY : :: c_int = 0 ;
127
115
pub const O_WRONLY : :: c_int = 1 ;
128
116
pub const O_RDWR : :: c_int = 2 ;
@@ -398,3 +386,15 @@ cfg_if! {
398
386
}
399
387
}
400
388
}
389
+
390
+ cfg_if ! {
391
+ if #[ cfg( all( target_env = "gnu" ) ) ] {
392
+ mod gnu;
393
+ pub use self :: gnu:: * ;
394
+ } else if #[ cfg( all( target_env = "msvc" ) ) ] {
395
+ mod msvc;
396
+ pub use self :: msvc:: * ;
397
+ } else {
398
+ // Unknown target_env
399
+ }
400
+ }
Original file line number Diff line number Diff line change
1
+ pub const L_tmpnam : :: c_uint = 260 ;
2
+ pub const TMP_MAX : :: c_uint = 0x7fff_ffff ;
3
+
4
+ extern {
5
+ #[ link_name = "_stricmp" ]
6
+ pub fn stricmp ( s1 : * const :: c_char , s2 : * const :: c_char ) -> :: c_int ;
7
+ #[ link_name = "_strnicmp" ]
8
+ pub fn strnicmp ( s1 : * const :: c_char , s2 : * const :: c_char ,
9
+ n : :: size_t ) -> :: c_int ;
10
+ }
You can’t perform that action at this time.
0 commit comments