33
44pub mod definitions;
55
6- #[ cfg( target_feature = "static-syscalls" ) ]
6+ #[ cfg( any(
7+ target_feature = "static-syscalls" ,
8+ all( target_arch = "bpf" , feature = "unstable-static-syscalls" )
9+ ) ) ]
710#[ macro_export]
811macro_rules! define_syscall {
912 ( $( #[ $attr: meta] ) * fn $name: ident( $( $arg: ident: $typ: ty) ,* ) -> $ret: ty) => {
@@ -26,7 +29,10 @@ macro_rules! define_syscall {
2629 }
2730}
2831
29- #[ cfg( not( target_feature = "static-syscalls" ) ) ]
32+ #[ cfg( not( any(
33+ target_feature = "static-syscalls" ,
34+ all( target_arch = "bpf" , feature = "unstable-static-syscalls" )
35+ ) ) ) ]
3036#[ macro_export]
3137macro_rules! define_syscall {
3238 ( $( #[ $attr: meta] ) * fn $name: ident( $( $arg: ident: $typ: ty) ,* ) -> $ret: ty) => {
@@ -40,12 +46,18 @@ macro_rules! define_syscall {
4046 }
4147}
4248
43- #[ cfg( target_feature = "static-syscalls" ) ]
49+ #[ cfg( any(
50+ target_feature = "static-syscalls" ,
51+ all( target_arch = "bpf" , feature = "unstable-static-syscalls" )
52+ ) ) ]
4453pub const fn sys_hash ( name : & str ) -> usize {
4554 murmur3_32 ( name. as_bytes ( ) , 0 ) as usize
4655}
4756
48- #[ cfg( target_feature = "static-syscalls" ) ]
57+ #[ cfg( any(
58+ target_feature = "static-syscalls" ,
59+ all( target_arch = "bpf" , feature = "unstable-static-syscalls" )
60+ ) ) ]
4961const fn murmur3_32 ( buf : & [ u8 ] , seed : u32 ) -> u32 {
5062 const fn pre_mix ( buf : [ u8 ; 4 ] ) -> u32 {
5163 u32:: from_le_bytes ( buf)
0 commit comments