@@ -2740,6 +2740,9 @@ fn test_linux(target: &str) {
2740
2740
| "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
2741
2741
| "Elf32_Chdr" | "Elf64_Chdr" => ty. to_string ( ) ,
2742
2742
2743
+ "Ioctl" if gnu => "unsigned long" . to_string ( ) ,
2744
+ "Ioctl" => "int" . to_string ( ) ,
2745
+
2743
2746
t if is_union => format ! ( "union {}" , t) ,
2744
2747
2745
2748
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
@@ -2797,6 +2800,9 @@ fn test_linux(target: &str) {
2797
2800
// on Linux, this is a volatile int
2798
2801
"pthread_spinlock_t" => true ,
2799
2802
2803
+ // For internal use only, to define architecture specific ioctl constants with a libc specific type.
2804
+ "Ioctl" => true ,
2805
+
2800
2806
_ => false ,
2801
2807
}
2802
2808
} ) ;
@@ -3227,6 +3233,7 @@ fn test_linux(target: &str) {
3227
3233
// This function tests APIs that are incompatible to test when other APIs
3228
3234
// are included (e.g. because including both sets of headers clashes)
3229
3235
fn test_linux_like_apis ( target : & str ) {
3236
+ let gnu = target. contains ( "gnu" ) ;
3230
3237
let musl = target. contains ( "musl" ) ;
3231
3238
let linux = target. contains ( "linux" ) ;
3232
3239
let emscripten = target. contains ( "emscripten" ) ;
@@ -3293,6 +3300,8 @@ fn test_linux_like_apis(target: &str) {
3293
3300
} )
3294
3301
. skip_struct ( |s| s != "termios2" )
3295
3302
. type_name ( move |ty, is_struct, is_union| match ty {
3303
+ "Ioctl" if gnu => "unsigned long" . to_string ( ) ,
3304
+ "Ioctl" => "int" . to_string ( ) ,
3296
3305
t if is_struct => format ! ( "struct {}" , t) ,
3297
3306
t if is_union => format ! ( "union {}" , t) ,
3298
3307
t => t. to_string ( ) ,
0 commit comments