mirror of
https://github.com/isar/rusqlite.git
synced 2025-03-30 01:33:00 +08:00
Use DLL_PREFIX / DLL_SUFFIX
This commit is contained in:
parent
68c3083e34
commit
05991e6755
@ -1,16 +1,20 @@
|
|||||||
//! Ensure loadable_extension.rs works.
|
//! Ensure loadable_extension.rs works.
|
||||||
|
|
||||||
use rusqlite::{Connection, Result};
|
use rusqlite::{Connection, Result};
|
||||||
|
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let db = Connection::open_in_memory()?;
|
let db = Connection::open_in_memory()?;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
db.load_extension_enable()?;
|
db.load_extension_enable()?;
|
||||||
#[cfg(not(windows))]
|
db.load_extension(
|
||||||
db.load_extension("target/debug/examples/libloadable_extension", None)?;
|
format!(
|
||||||
#[cfg(windows)]
|
"target/debug/examples/{}loadable_extension{}",
|
||||||
db.load_extension("target/debug/examples/loadable_extension", None)?;
|
DLL_PREFIX, DLL_SUFFIX
|
||||||
|
),
|
||||||
|
None,
|
||||||
|
)?;
|
||||||
db.load_extension_disable()?;
|
db.load_extension_disable()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user