Skip to content

Commit 8c27f06

Browse files
committed
Using cargo features now!
Signed-off-by: Peter Atashian <retep998@gmail.com>
1 parent 42dffdb commit 8c27f06

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@
33
name = "winapi"
44
version = "0.0.1"
55
authors = ["Peter Atashian <retep998@gmail.com>"]
6+
description = "WinAPI FFI bindings. Use this for building higher level abstractions."
7+
repository = "https://github.com/retep998/winapi-rs"
8+
readme = "README.md"
9+
keywords = ["Windows", "win32", "WinAPI", "FFI"]
10+
license = "MIT"
11+
12+
[features]
13+
advapi32 = []
14+
kernel32 = []
15+
ole32 = []
16+
shell32 = []

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,7 @@ pub static ENABLE_WRAP_AT_EOL_OUTPUT: DWORD = 0x2;
15361536
// Functions
15371537
//-------------------------------------------------------------------------------------------------
15381538

1539+
#[cfg(feature = "ole32")]
15391540
#[link(name = "ole32")]
15401541
extern "system" {
15411542
pub fn CoAllowUnmarshalerCLSID(
@@ -1610,6 +1611,7 @@ extern "system" {
16101611
phglobal: *mut HGLOBAL,
16111612
) -> HRESULT;
16121613
}
1614+
#[cfg(feature = "shell32")]
16131615
#[link(name = "shell32")]
16141616
extern "system" {
16151617
pub fn SHCloneSpecialIDList(
@@ -1758,6 +1760,7 @@ extern "system" {
17581760
pszPath: PCWSTR,
17591761
) -> HRESULT;
17601762
}
1763+
#[cfg(feature = "kernel32")]
17611764
#[link(name = "kernel32")]
17621765
extern "system" {
17631766
pub fn CloseHandle(
@@ -1824,6 +1827,7 @@ extern "system" {
18241827
lpNumberOfBytesWritten: *mut SIZE_T,
18251828
) -> BOOL;
18261829
}
1830+
#[cfg(feature = "advapi32")]
18271831
#[link(name = "advapi32")]
18281832
extern "system" {
18291833
pub fn AdjustTokenPrivileges(

0 commit comments

Comments
 (0)