Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DLL_PREFIX / DLL_SUFFIX #1431

Merged
merged 1 commit into from Jan 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions examples/load_extension.rs
@@ -1,16 +1,20 @@
//! Ensure loadable_extension.rs works.

use rusqlite::{Connection, Result};
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};

fn main() -> Result<()> {
let db = Connection::open_in_memory()?;

unsafe {
db.load_extension_enable()?;
#[cfg(not(windows))]
db.load_extension("target/debug/examples/libloadable_extension", None)?;
#[cfg(windows)]
db.load_extension("target/debug/examples/loadable_extension", None)?;
db.load_extension(
format!(
"target/debug/examples/{}loadable_extension{}",
DLL_PREFIX, DLL_SUFFIX
),
None,
)?;

Check warning on line 17 in examples/load_extension.rs

View check run for this annotation

Codecov / codecov/patch

examples/load_extension.rs#L11-L17

Added lines #L11 - L17 were not covered by tests
db.load_extension_disable()?;
}

Expand Down