@@ -106,7 +106,7 @@ fn do_semver() {
106106 // maintain a file for Android.
107107 // NOTE: AIX doesn't include the unix file because there are definitions
108108 // missing on AIX. It is easier to maintain a file for AIX.
109- if family != os && !matches ! ( os. as_str( ) , "android" | "aix" ) {
109+ if family != os && !matches ! ( os. as_str( ) , "android" | "aix" ) && os != "vxworks" {
110110 process_semver_file ( & mut output, & mut semver_root, & family) ;
111111 }
112112 // We don't do semver for unknown targets.
@@ -3333,13 +3333,33 @@ fn test_neutrino(target: &str) {
33333333 ctest:: generate_test ( & mut cfg, "../src/lib.rs" , "ctest_output.rs" ) . unwrap ( ) ;
33343334}
33353335
3336+ fn which_vxworks ( ) -> Option < ( u32 , u32 ) > {
3337+ let version = env:: var ( "WIND_RELEASE_ID" ) . ok ( ) ?; // When in VxWorks setup, WIND_RELEASE_ID is
3338+ // always set as the version of the release.
3339+
3340+ let mut pieces = version. trim ( ) . split ( [ '.' ] ) ;
3341+
3342+ let major: u32 = pieces. next ( ) . and_then ( |x| x. parse ( ) . ok ( ) ) . unwrap_or ( 0 ) ;
3343+ let minor: u32 = pieces. next ( ) . and_then ( |x| x. parse ( ) . ok ( ) ) . unwrap_or ( 0 ) ;
3344+
3345+ Some ( ( major, minor) )
3346+ }
3347+
33363348fn test_vxworks ( target : & str ) {
33373349 assert ! ( target. contains( "vxworks" ) ) ;
33383350
33393351 let mut cfg = ctest_cfg ( ) ;
3352+
3353+ let vxworks_ver = which_vxworks ( ) ;
3354+
3355+ if vxworks_ver < Some ( ( 25 , 9 ) ) {
3356+ cfg. cfg ( "vxworks_lt_25_09" , None ) ;
3357+ }
3358+
33403359 headers ! (
33413360 cfg,
33423361 "vxWorks.h" ,
3362+ "semLibCommon.h" ,
33433363 "yvals.h" ,
33443364 "nfs/nfsCommon.h" ,
33453365 "rtpLibCommon.h" ,
@@ -3356,13 +3376,11 @@ fn test_vxworks(target: &str) {
33563376 "elf.h" ,
33573377 "fcntl.h" ,
33583378 "grp.h" ,
3359- "sys/poll.h" ,
33603379 "ifaddrs.h" ,
33613380 "langinfo.h" ,
33623381 "limits.h" ,
33633382 "link.h" ,
33643383 "locale.h" ,
3365- "sys/stat.h" ,
33663384 "netdb.h" ,
33673385 "pthread.h" ,
33683386 "pwd.h" ,
@@ -3374,6 +3392,9 @@ fn test_vxworks(target: &str) {
33743392 "stdio.h" ,
33753393 "stdlib.h" ,
33763394 "string.h" ,
3395+ "sys/select.h" ,
3396+ "sys/stat.h" ,
3397+ "sys/poll.h" ,
33773398 "sys/file.h" ,
33783399 "sys/ioctl.h" ,
33793400 "sys/socket.h" ,
@@ -3384,7 +3405,14 @@ fn test_vxworks(target: &str) {
33843405 "sys/un.h" ,
33853406 "sys/utsname.h" ,
33863407 "sys/wait.h" ,
3408+ "sys/ttycom.h" ,
3409+ "sys/utsname.h" ,
3410+ "sys/resource.h" ,
3411+ "sys/mman.h" ,
33873412 "netinet/tcp.h" ,
3413+ "netinet/udp.h" ,
3414+ "netinet/in.h" ,
3415+ "netinet6/in6.h" ,
33883416 "syslog.h" ,
33893417 "termios.h" ,
33903418 "time.h" ,
@@ -3393,16 +3421,22 @@ fn test_vxworks(target: &str) {
33933421 "utime.h" ,
33943422 "wchar.h" ,
33953423 "errno.h" ,
3396- "sys/mman.h" ,
33973424 "pathLib.h" ,
33983425 "mqueue.h" ,
3426+ "fnmatch.h" ,
3427+ "sioLibCommon.h" ,
3428+ "net/if.h" ,
33993429 ) ;
34003430 // FIXME(vxworks)
34013431 cfg. skip_const ( move |constant| match constant. ident ( ) {
34023432 // sighandler_t weirdness
34033433 "SIG_DFL" | "SIG_ERR" | "SIG_IGN"
3404- // This is not defined in vxWorks
3405- | "RTLD_DEFAULT" => true ,
3434+ // These are not defined in VxWorks
3435+ | "RTLD_DEFAULT" | "PRIO_PROCESS"
3436+ // Sticky bits not supported
3437+ | "S_ISVTX"
3438+ // The following are obsolete for VxWorks
3439+ | "SIGIO" | "SIGWINCH" | "SIGLOST" => true ,
34063440 _ => false ,
34073441 } ) ;
34083442 // FIXME(vxworks)
@@ -3413,7 +3447,12 @@ fn test_vxworks(target: &str) {
34133447
34143448 cfg. skip_struct_field_type (
34153449 move |struct_, field| match ( struct_. ident ( ) , field. ident ( ) ) {
3416- ( "siginfo_t" , "si_value" ) | ( "stat" , "st_size" ) | ( "sigaction" , "sa_u" ) => true ,
3450+ ( "siginfo_t" , "si_value" )
3451+ | ( "stat" , "st_size" )
3452+ // sighandler_t type is super weird
3453+ | ( "sigaction" , "sa_sigaction" )
3454+ // sa_u_t type is not defined in vxworks
3455+ | ( "sigaction" , "sa_u" ) => true ,
34173456 _ => false ,
34183457 } ,
34193458 ) ;
@@ -3430,11 +3469,16 @@ fn test_vxworks(target: &str) {
34303469 cfg. skip_fn ( move |func| match func. ident ( ) {
34313470 // sighandler_t
34323471 "signal"
3472+ // This is used a realpath and not _realpath
3473+ | "_realpath"
34333474 // not used in static linking by default
34343475 | "dlerror" => true ,
34353476 _ => false ,
34363477 } ) ;
34373478
3479+ // Not defined in vxworks. Just a crate specific union type.
3480+ cfg. skip_union ( move |u| u. ident ( ) == "sa_u_t" ) ;
3481+
34383482 ctest:: generate_test ( & mut cfg, "../src/lib.rs" , "ctest_output.rs" ) . unwrap ( ) ;
34393483}
34403484
0 commit comments