File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ edition = "2018"
77publish = false
88
99[build-dependencies ]
10- bindgen = " 0.54.0 "
11- cmake = " 0.1.44 "
10+ bindgen = " 0.72.1 "
11+ cmake = " 0.1.54 "
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ fn get_cpp_link_stdlib() -> Option<String> {
2323}
2424
2525fn main ( ) {
26- let version = "0.9 .2" ;
26+ let version = "4.2 .2" ;
2727 let download_url =
2828 "https://github.com/simdjson/simdjson/archive/refs/tags/v" . to_owned ( ) + version + ".tar.gz" ;
2929 let out_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
@@ -54,7 +54,6 @@ fn main() {
5454 // .define("CMAKE_C_COMPILER", "clang")
5555 // .define("CMAKE_CXX_COMPILER", "gcc")
5656 // .define("CMAKE_C_COMPILER", "gcc")
57- . uses_cxx11 ( )
5857 . build ( ) ;
5958 eprintln ! ( "building done" ) ;
6059
@@ -67,14 +66,14 @@ fn main() {
6766
6867 eprintln ! ( "bindings" ) ;
6968 let bindings = bindgen:: Builder :: default ( )
70- . clang_args ( & [
69+ . clang_args ( [
7170 "-xc++" ,
7271 "-std=c++17" ,
7372 & ( "-I" . to_owned ( ) + & simdjson_dir + "/include" ) ,
7473 ] )
7574 . header ( & ( simdjson_dir. to_owned ( ) + "/include/simdjson/implementation.h" ) )
76- . whitelist_function ( "simdjson::validate_utf8" )
77- . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) )
75+ . allowlist_function ( "simdjson::validate_utf8" )
76+ . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks :: new ( ) ) )
7877 . generate ( )
7978 . expect ( "unable to generate bindings" ) ;
8079 eprintln ! ( "bindings done" ) ;
Original file line number Diff line number Diff line change 1- #![ expect( non_camel_case_types) ]
21use std:: os:: raw:: c_char;
2+ use std:: os:: raw:: c_ulong;
33
44include ! ( concat!( env!( "OUT_DIR" ) , "/bindings.rs" ) ) ;
55
66#[ inline( always) ] // only works if simdjson ist compiled with LLVM and cross-language LTO is enabled
77pub fn validate ( bytes : & [ u8 ] ) -> bool {
8- unsafe { simdjson_validate_utf8 ( bytes. as_ptr ( ) as * const c_char , bytes. len ( ) as size_t ) }
8+ unsafe { simdjson_validate_utf8 ( bytes. as_ptr ( ) as * const c_char , bytes. len ( ) as c_ulong ) }
99}
1010
1111#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments