Skip to content

Commit

Permalink
change approach to linking
Browse files Browse the repository at this point in the history
  • Loading branch information
chayleaf committed Jul 5, 2023
1 parent 7b7b795 commit fa85913
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 124 deletions.
2 changes: 1 addition & 1 deletion src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ macro_rules! reexport {
let sym = CELL.get_or_init(|| {
sym($link)
.or_else(|_| sym(&$link[1..]))
.or_else(|_| sym(&$link[2..]))
.or_else(|_| sym(stringify!($name)))
.or_else(|_| sym(Box::leak(Box::new("\x01".to_owned() + $link)).as_str()))
.expect(&format!("failed to load symbol: {}", $link))
});
sym($( $arg ),*)
Expand Down
6 changes: 3 additions & 3 deletions src/linux_reexports.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
reexport!("\u{1}_ZN23SteamNetworkingIdentity15SetGenericBytesEPKvm", fn SteamNetworkingIdentity_SetGenericBytes(this : * mut SteamNetworkingIdentity, data : * const :: std :: os :: raw :: c_void, cbLen : size_t) -> bool);
reexport!("\u{1}_ZNK23SteamNetworkingIdentity8ToStringEPcm", fn SteamNetworkingIdentity_ToString(this : * const SteamNetworkingIdentity, buf : * mut :: std :: os :: raw :: c_char, cbBuf : size_t));
reexport!("\u{1}_ZN21ISteamNetworkingUtils20SetConfigValueStructERK28SteamNetworkingConfigValue_t27ESteamNetworkingConfigScopel", fn ISteamNetworkingUtils_SetConfigValueStruct(this : * mut ISteamNetworkingUtils, opt : * const SteamNetworkingConfigValue_t, eScopeType : ESteamNetworkingConfigScope, scopeObj : isize) -> bool);
reexport!("_ZN23SteamNetworkingIdentity15SetGenericBytesEPKvm", fn SteamNetworkingIdentity_SetGenericBytes(this : * mut SteamNetworkingIdentity, data : * const :: std :: os :: raw :: c_void, cbLen : size_t) -> bool);
reexport!("_ZNK23SteamNetworkingIdentity8ToStringEPcm", fn SteamNetworkingIdentity_ToString(this : * const SteamNetworkingIdentity, buf : * mut :: std :: os :: raw :: c_char, cbBuf : size_t));
reexport!("_ZN21ISteamNetworkingUtils20SetConfigValueStructERK28SteamNetworkingConfigValue_t27ESteamNetworkingConfigScopel", fn ISteamNetworkingUtils_SetConfigValueStruct(this : * mut ISteamNetworkingUtils, opt : * const SteamNetworkingConfigValue_t, eScopeType : ESteamNetworkingConfigScope, scopeObj : isize) -> bool);
Loading

0 comments on commit fa85913

Please sign in to comment.