Skip to content

Commit

Permalink
fix: CoInitializeEx/CoUninitialize are stdcall
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jun 29, 2020
1 parent 0b7683d commit d847d05
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions release/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,6 @@ async function main(args) {
let ldextra = "";
if (opts.os === "windows") {
libs = [...libs, "ws2_32", "advapi32", "shell32", "userenv", "ole32"];

if (opts.arch === "i686") {
// on i686, the mingw import library `libole32.a`
// is missing symbols for `CoIncrementMTAUsage`.
// note: we can't add "-Wl,--enable-stdcall-fixup" because it's
// not whitelisted as of Go 1.14.3 - so, we'll have to live
// with the warnings
ldextra = "c:/Windows/System32/ole32.dll";
}
} else if (opts.os === "linux") {
libs = [...libs, "dl"];
}
Expand Down
2 changes: 1 addition & 1 deletion src/windows/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum Error {
}

#[link(name = "ole32")]
extern "C" {
extern "stdcall" {
fn CoInitializeEx(pvReserved: *mut c_void, dwCoInit: u32) -> HRESULT;
fn CoUninitialize();
}
Expand Down

0 comments on commit d847d05

Please sign in to comment.