File tree 3 files changed +18
-11
lines changed
3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ pub const SECP256K1_START_VERIFY: c_uint = 1 | (1 << 8);
43
43
/// Flag for context to enable signing precomputation
44
44
pub const SECP256K1_START_SIGN : c_uint = 1 | ( 1 << 9 ) ;
45
45
/// Flag for keys to indicate uncompressed serialization format
46
+ #[ allow( unused_parens) ]
46
47
pub const SECP256K1_SER_UNCOMPRESSED : c_uint = ( 1 << 1 ) ;
47
48
/// Flag for keys to indicate compressed serialization format
48
49
pub const SECP256K1_SER_COMPRESSED : c_uint = ( 1 << 1 ) | ( 1 << 8 ) ;
@@ -629,7 +630,8 @@ pub unsafe extern "C" fn rustsecp256k1_v0_3_1_default_error_callback_fn(message:
629
630
panic ! ( "[libsecp256k1] internal consistency check failed {}" , msg) ;
630
631
}
631
632
632
-
633
+ #[ no_mangle]
634
+ #[ cfg( not( feature = "external-symbols" ) ) ]
633
635
unsafe fn strlen ( mut str_ptr : * const c_char ) -> usize {
634
636
let mut ctr = 0 ;
635
637
while * str_ptr != '\0' as c_char {
@@ -1160,11 +1162,13 @@ pub use self::fuzz_dummy::*;
1160
1162
1161
1163
#[ cfg( test) ]
1162
1164
mod tests {
1163
- use std:: ffi:: CString ;
1164
- use super :: strlen;
1165
-
1165
+ #[ no_mangle]
1166
+ #[ cfg( not( feature = "external-symbols" ) ) ]
1166
1167
#[ test]
1167
1168
fn test_strlen ( ) {
1169
+ use std:: ffi:: CString ;
1170
+ use super :: strlen;
1171
+
1168
1172
let orig = "test strlen \t \n " ;
1169
1173
let test = CString :: new ( orig) . unwrap ( ) ;
1170
1174
Original file line number Diff line number Diff line change @@ -34,13 +34,6 @@ macro_rules! impl_array_newtype {
34
34
dat. as_mut_ptr( )
35
35
}
36
36
37
- #[ inline]
38
- /// Gets a reference to the underlying array
39
- pub fn as_ref( & self ) -> & [ $ty; $len] {
40
- let & $thing( ref dat) = self ;
41
- dat
42
- }
43
-
44
37
#[ inline]
45
38
/// Returns the length of the object as an array
46
39
pub fn len( & self ) -> usize { $len }
@@ -50,6 +43,15 @@ macro_rules! impl_array_newtype {
50
43
pub fn is_empty( & self ) -> bool { false }
51
44
}
52
45
46
+ impl AsRef <[ $ty; $len] > for $thing {
47
+ #[ inline]
48
+ /// Gets a reference to the underlying array
49
+ fn as_ref( & self ) -> & [ $ty; $len] {
50
+ let & $thing( ref dat) = self ;
51
+ dat
52
+ }
53
+ }
54
+
53
55
impl PartialEq for $thing {
54
56
#[ inline]
55
57
fn eq( & self , other: & $thing) -> bool {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ impl AlignedType {
40
40
}
41
41
}
42
42
43
+ #[ cfg( all( feature = "std" , not( feature = "external-symbols" ) ) ) ]
43
44
pub ( crate ) const ALIGN_TO : usize = mem:: align_of :: < AlignedType > ( ) ;
44
45
45
46
You can’t perform that action at this time.
0 commit comments