Skip to content

Commit 0604ef9

Browse files
committed
Gotta do the export workaround for CreateInterface_MMS too...
1 parent 9929f15 commit 0604ef9

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

extshared/src/export_GetSMExtAPI.rs renamed to extshared/src/export_sourcemod_extension_symbols.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
2-
// Copyright 2022 rtldg <[email protected]>
2+
// Copyright 2022-2025 rtldg <[email protected]>
33
// This file is part of srcwrtimer (https://github.com/srcwr/srcwrtimer/)
44

55
use core::ffi::c_void;
@@ -9,6 +9,9 @@ unsafe extern "C" {
99
pub fn GetSMExtAPIxxx() -> *const c_void;
1010
#[cfg(target_os = "windows")]
1111
pub fn GetSMExtAPI() -> *const c_void;
12+
13+
#[cfg(target_os = "linux")]
14+
pub fn CreateInterface_MMSxxx(mvi: *const c_void, mli: *const c_void) -> *const c_void;
1215
}
1316

1417
/// This is our hack to "re-export" GetSMExtAPI from smsdk_ext.cpp...
@@ -21,6 +24,12 @@ pub unsafe extern "C" fn GetSMExtAPI() -> *const c_void {
2124
unsafe { GetSMExtAPIxxx() }
2225
}
2326

27+
#[cfg(target_os = "linux")]
28+
#[unsafe(no_mangle)]
29+
pub unsafe extern "C" fn CreateInterface_MMS(mvi: *const c_void, mli: *const c_void) -> *const c_void {
30+
unsafe { CreateInterface_MMSxxx(mvi, mli) }
31+
}
32+
2433
/// We have to call this so the symbol won't be optimized out...
2534
pub fn doit() {
2635
let _ = unsafe { GetSMExtAPI() };

extshared/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::ptr::NonNull;
1111

1212
pub mod ICellArray;
1313
pub mod IFileObject;
14-
pub mod export_GetSMExtAPI;
14+
pub mod export_sourcemod_extension_symbols;
1515
pub mod smext_conf_boilerplate;
1616

1717
/*

extshared/src/smext_conf_boilerplate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ macro_rules! smext_conf_boilerplate_extension_info_single {
7878
#[allow(clippy::not_unsafe_ptr_arg_deref)]
7979
pub extern "C" fn rust_sdk_on_load_wrapper(error: *mut u8, maxlength: usize, late: bool) -> bool {
8080
use std::io::Write as _;
81-
extshared::export_GetSMExtAPI::doit();
81+
extshared::export_sourcemod_extension_symbols::doit();
8282
match rust_sdk_on_load(late) {
8383
Ok(_) => true,
8484
Err(e) => {

extshared_build_helper/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ pub fn smext_build() -> cc::Build {
376376
.define("_LINUX", None)
377377
.define("LINUX", None)
378378
.define("GetSMExtAPI", "GetSMExtAPIxxx")
379+
.define("CreateInterface_MMS", "CreateInterface_MMSxxx")
379380
.define("POSIX", None);
380381
}
381382

0 commit comments

Comments
 (0)