Skip to content

Commit

Permalink
support for iodbc
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Mar 12, 2021
1 parent b594c02 commit b159069
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "odbc-sys"
version = "0.17.1"
version = "0.17.2"
authors = ["Markus Klein <markus-klein@live.de>"]
license = "MIT"
description = "ODBC ffi bindings"
Expand All @@ -16,6 +16,7 @@ categories = ["external-ffi-bindings", "database"]
[features]
default = ["odbc_version_3_80"]
static = []
iodbc = []

odbc_version_3_50 = []
odbc_version_3_80 = ["odbc_version_3_50"]
Expand Down
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,11 @@ Design Goals
* As it is as of now unlikely to happen that anyone is writing ODBC 2.0 applications in Rust
therefore deprecated symbols like 'SQLAllocEnv' have been left out intentionally.

Linking
-------

This library will link against `odbc32.dll` (preinstalled) on Windows systems. On Linux and OS-X it links against `libodbc.so` by default. This is typically provided by [unix-odbc](http://www.unixodbc.org/). Using the `--feature iodbc` you can also link against `libiodbc.so`. This may be interessting if you are trying to connect to some older data sources on OS-X.

Current State
-------------

Expand Down
6 changes: 4 additions & 2 deletions src/functions.rs
Expand Up @@ -7,8 +7,10 @@ use crate::{

// static linking is not currently supported here for windows
#[cfg_attr(windows, link(name = "odbc32"))]
#[cfg_attr(all(not(windows), not(r#static)), link(name = "odbc"))]
#[cfg_attr(all(not(windows), r#static), link(name = "odbc", kind = "static"))]
#[cfg_attr(all(not(windows), not(feature = "static"), not(feature = "iodbc")), link(name = "odbc"))]
#[cfg_attr(all(not(windows), feature = "static", not(feature = "iodbc")), link(name = "odbc", kind = "static"))]
#[cfg_attr(all(not(windows), not(feature = "static"), feature = "iodbc"), link(name = "iodbc"))]
#[cfg_attr(all(not(windows), feature = "static", feature = "iodbc"), link(name = "iodbc", kind = "static"))]
extern "system" {
/// Allocates an environment, connection, statement, or descriptor handle.
///
Expand Down

0 comments on commit b159069

Please sign in to comment.