mirror of
https://github.com/isar/rusqlite.git
synced 2025-02-19 22:38:14 +08:00
Merge pull request #816 from gwenn/ptr_offset_from
Feature ptr_offset_from #41079 available in 1.47
This commit is contained in:
commit
2461540306
@ -370,10 +370,7 @@ mod bindings {
|
|||||||
fn generating_bundled_bindings() -> bool {
|
fn generating_bundled_bindings() -> bool {
|
||||||
// Hacky way to know if we're generating the bundled bindings
|
// Hacky way to know if we're generating the bundled bindings
|
||||||
println!("cargo:rerun-if-env-changed=LIBSQLITE3_SYS_BUNDLING");
|
println!("cargo:rerun-if-env-changed=LIBSQLITE3_SYS_BUNDLING");
|
||||||
match std::env::var("LIBSQLITE3_SYS_BUNDLING") {
|
matches!(std::env::var("LIBSQLITE3_SYS_BUNDLING"), Ok(v) if v != "0")
|
||||||
Ok(v) if v != "0" => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_to_out_dir(header: HeaderLocation, out_path: &Path) {
|
pub fn write_to_out_dir(header: HeaderLocation, out_path: &Path) {
|
||||||
|
@ -250,8 +250,7 @@ impl InnerConnection {
|
|||||||
let tail = if c_tail.is_null() {
|
let tail = if c_tail.is_null() {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
// TODO nightly feature ptr_offset_from #41079
|
let n = unsafe { c_tail.offset_from(c_sql) };
|
||||||
let n = (c_tail as isize) - (c_sql as isize);
|
|
||||||
if n <= 0 || n >= len as isize {
|
if n <= 0 || n >= len as isize {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user