Merge branch 'master' into semver-check

This commit is contained in:
John Gallagher 2017-02-23 15:36:54 -05:00 committed by GitHub
commit 39d71810ce
17 changed files with 22 additions and 28 deletions

View File

@ -17,3 +17,4 @@ rusqlite contributors
* [Chip Collier](https://github.com/photex) * [Chip Collier](https://github.com/photex)
* [Omar Ferrer](https://github.com/chamakits) * [Omar Ferrer](https://github.com/chamakits)
* [Lee Jenkins](https://github.com/reddraggone9) * [Lee Jenkins](https://github.com/reddraggone9)
* [miedzinski](https://github.com/miedzinski)

View File

@ -30,7 +30,6 @@ limits = []
time = "0.1.0" time = "0.1.0"
bitflags = "0.7" bitflags = "0.7"
lru-cache = "0.1.0" lru-cache = "0.1.0"
libc = "0.2"
chrono = { version = "0.3", optional = true } chrono = { version = "0.3", optional = true }
serde_json = { version = "0.9", optional = true } serde_json = { version = "0.9", optional = true }

View File

@ -17,6 +17,7 @@
* rusqlite now performs a one-time check (prior to the first connection attempt) that the runtime * rusqlite now performs a one-time check (prior to the first connection attempt) that the runtime
SQLite version is at least as new as the SQLite version found at buildtime. This check can by SQLite version is at least as new as the SQLite version found at buildtime. This check can by
skipped by calling the unsafe function `rusqlite::bypass_sqlite_version_check()`. skipped by calling the unsafe function `rusqlite::bypass_sqlite_version_check()`.
* Removes the `libc` dependency in favor of using `std::os::raw`
# Version 0.9.5 (2017-01-26) # Version 0.9.5 (2017-01-26)

View File

@ -7,6 +7,8 @@ description = "Native bindings to the libsqlite3 library"
license = "MIT" license = "MIT"
links = "sqlite3" links = "sqlite3"
build = "build.rs" build = "build.rs"
keywords = ["sqlite", "database", "ffi"]
categories = ["database", "external-ffi-bindings"]
[features] [features]
bundled = [] bundled = []
@ -15,6 +17,3 @@ bundled = []
bindgen = "0.21" bindgen = "0.21"
pkg-config = "0.3" pkg-config = "0.3"
gcc = "0.3" gcc = "0.3"
[dependencies]
libc = "0.2"

View File

@ -27,7 +27,6 @@ fn run_bindgen<T: Into<String>>(header: T) {
let mut output = Vec::new(); let mut output = Vec::new();
bindgen::builder() bindgen::builder()
.header(header.clone()) .header(header.clone())
.ctypes_prefix("::libc")
.type_chooser(Box::new(SqliteTypeChooser)) .type_chooser(Box::new(SqliteTypeChooser))
.generate() .generate()
.expect(&format!("could not run bindgen on header {}", header)) .expect(&format!("could not run bindgen on header {}", header))

View File

@ -1,4 +1,4 @@
use libc::c_int; use std::os::raw::c_int;
use std::error; use std::error;
use std::fmt; use std::fmt;

View File

@ -1,7 +1,5 @@
#![allow(non_snake_case, non_camel_case_types)] #![allow(non_snake_case, non_camel_case_types)]
extern crate libc;
pub use self::error::*; pub use self::error::*;
use std::mem; use std::mem;

View File

@ -30,7 +30,7 @@ use std::marker::PhantomData;
use std::path::Path; use std::path::Path;
use std::ptr; use std::ptr;
use libc::c_int; use std::os::raw::c_int;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;

View File

@ -2,7 +2,7 @@ use std::error;
use std::fmt; use std::fmt;
use std::path::PathBuf; use std::path::PathBuf;
use std::str; use std::str;
use libc::c_int; use std::os::raw::c_int;
use {ffi, errmsg_to_string}; use {ffi, errmsg_to_string};
use types::Type; use types::Type;

View File

@ -54,7 +54,7 @@ use std::ffi::CStr;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use std::slice; use std::slice;
use libc::{c_int, c_char, c_void}; use std::os::raw::{c_int, c_char, c_void};
use ffi; use ffi;
use ffi::sqlite3_context; use ffi::sqlite3_context;
@ -508,7 +508,7 @@ mod test {
extern crate regex; extern crate regex;
use std::collections::HashMap; use std::collections::HashMap;
use libc::c_double; use std::os::raw::c_double;
use self::regex::Regex; use self::regex::Regex;
use std::f64::EPSILON; use std::f64::EPSILON;

View File

@ -52,7 +52,6 @@
//! ``` //! ```
#![allow(unknown_lints)] #![allow(unknown_lints)]
extern crate libc;
extern crate libsqlite3_sys as ffi; extern crate libsqlite3_sys as ffi;
extern crate lru_cache; extern crate lru_cache;
#[macro_use] #[macro_use]
@ -74,7 +73,7 @@ use std::result;
use std::str; use std::str;
use std::sync::{Once, ONCE_INIT}; use std::sync::{Once, ONCE_INIT};
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use libc::{c_int, c_char, c_void}; use std::os::raw::{c_int, c_char, c_void};
use types::{ToSql, ToSqlOutput, FromSql, FromSqlError, ValueRef}; use types::{ToSql, ToSqlOutput, FromSql, FromSqlError, ValueRef};
use error::{error_from_sqlite_code, error_from_handle}; use error::{error_from_sqlite_code, error_from_handle};
@ -208,7 +207,7 @@ impl Connection {
/// Open a new connection to a SQLite database. /// Open a new connection to a SQLite database.
/// ///
/// Database Connection](http://www.sqlite.org/c3ref/open.html) for a description of valid /// [Database Connection](http://www.sqlite.org/c3ref/open.html) for a description of valid
/// flag combinations. /// flag combinations.
/// ///
/// # Failure /// # Failure
@ -228,7 +227,7 @@ impl Connection {
/// Open a new connection to an in-memory SQLite database. /// Open a new connection to an in-memory SQLite database.
/// ///
/// Database Connection](http://www.sqlite.org/c3ref/open.html) for a description of valid /// [Database Connection](http://www.sqlite.org/c3ref/open.html) for a description of valid
/// flag combinations. /// flag combinations.
/// ///
/// # Failure /// # Failure
@ -534,7 +533,7 @@ bitflags! {
#[doc = "Flags for opening SQLite database connections."] #[doc = "Flags for opening SQLite database connections."]
#[doc = "See [sqlite3_open_v2](http://www.sqlite.org/c3ref/open.html) for details."] #[doc = "See [sqlite3_open_v2](http://www.sqlite.org/c3ref/open.html) for details."]
#[repr(C)] #[repr(C)]
pub flags OpenFlags: ::libc::c_int { pub flags OpenFlags: ::std::os::raw::c_int {
const SQLITE_OPEN_READ_ONLY = 0x00000001, const SQLITE_OPEN_READ_ONLY = 0x00000001,
const SQLITE_OPEN_READ_WRITE = 0x00000002, const SQLITE_OPEN_READ_WRITE = 0x00000002,
const SQLITE_OPEN_CREATE = 0x00000004, const SQLITE_OPEN_CREATE = 0x00000004,
@ -778,7 +777,7 @@ impl InnerConnection {
Ok(()) Ok(())
} else { } else {
let message = errmsg_to_string(&*errmsg); let message = errmsg_to_string(&*errmsg);
ffi::sqlite3_free(errmsg as *mut libc::c_void); ffi::sqlite3_free(errmsg as *mut ::std::os::raw::c_void);
Err(error_from_sqlite_code(r, Some(message))) Err(error_from_sqlite_code(r, Some(message)))
} }
} }
@ -1393,7 +1392,7 @@ mod test {
let raw_stmt = { let raw_stmt = {
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use libc::c_int; use std::os::raw::c_int;
use super::str_to_cstring; use super::str_to_cstring;
let raw_db = db.db.borrow_mut().db; let raw_db = db.db.borrow_mut().db;

View File

@ -1,6 +1,6 @@
//! Run-Time Limits //! Run-Time Limits
use libc::c_int; use std::os::raw::c_int;
use ffi; use ffi;
pub use ffi::Limit; pub use ffi::Limit;

View File

@ -1,6 +1,6 @@
use std::convert; use std::convert;
use std::result; use std::result;
use libc::c_int; use std::os::raw::c_int;
use {Result, Error, Connection, Statement, MappedRows, AndThenRows, Rows, Row, str_to_cstring}; use {Result, Error, Connection, Statement, MappedRows, AndThenRows, Rows, Row, str_to_cstring};
use types::ToSql; use types::ToSql;

View File

@ -1,6 +1,6 @@
use std::ffi::CStr; use std::ffi::CStr;
use std::ptr; use std::ptr;
use libc::c_int; use std::os::raw::c_int;
use super::ffi; use super::ffi;
// Private newtype for raw sqlite3_stmts that finalize themselves when dropped. // Private newtype for raw sqlite3_stmts that finalize themselves when dropped.

View File

@ -1,6 +1,6 @@
//! Tracing and profiling functions. Error and warning log. //! Tracing and profiling functions. Error and warning log.
use libc::{c_char, c_int, c_void}; use std::os::raw::{c_char, c_int, c_void};
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
use std::mem; use std::mem;
use std::ptr; use std::ptr;

View File

@ -73,11 +73,10 @@ mod serde_json;
/// ## Example /// ## Example
/// ///
/// ```rust,no_run /// ```rust,no_run
/// # extern crate libc;
/// # extern crate rusqlite; /// # extern crate rusqlite;
/// # use rusqlite::{Connection, Result}; /// # use rusqlite::{Connection, Result};
/// # use rusqlite::types::{Null}; /// # use rusqlite::types::{Null};
/// # use libc::{c_int}; /// # use std::os::raw::{c_int};
/// fn main() { /// fn main() {
/// } /// }
/// fn insert_null(conn: &Connection) -> Result<c_int> { /// fn insert_null(conn: &Connection) -> Result<c_int> {
@ -114,7 +113,7 @@ mod test {
use Connection; use Connection;
use Error; use Error;
use libc::{c_int, c_double}; use std::os::raw::{c_int, c_double};
use std::f64::EPSILON; use std::f64::EPSILON;
use super::Value; use super::Value;

View File

@ -3,12 +3,11 @@
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
extern crate libc;
extern crate rusqlite; extern crate rusqlite;
#[cfg(feature = "trace")] #[cfg(feature = "trace")]
fn main() { fn main() {
use libc::c_int; use std::os::raw::c_int;
use std::sync::Mutex; use std::sync::Mutex;
lazy_static! { lazy_static! {