fix(windows): add memset_explicit symbol export for mingw cross-compilation
Some checks failed
Test / frontend-typecheck (pull_request) Successful in 1m57s
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Successful in 1m46s
PR Review Automation / review (pull_request) Successful in 4m30s
Test / rust-tests (pull_request) Has been cancelled
Some checks failed
Test / frontend-typecheck (pull_request) Successful in 1m57s
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Successful in 1m46s
PR Review Automation / review (pull_request) Successful in 4m30s
Test / rust-tests (pull_request) Has been cancelled
- Add __declspec(dllexport) to memset_explicit in memset_s_shim.c - Explicitly link memset_shim library in build.rs for Windows MinGW target - Fixes undefined reference to memset_explicit when building for x86_64-pc-windows-gnu
This commit is contained in:
parent
b6ecd49b52
commit
d45e767d6d
@ -13,6 +13,8 @@ fn main() {
|
||||
.file("memset_s_shim.c")
|
||||
.compile("memset_shim");
|
||||
println!("cargo:rerun-if-changed=memset_s_shim.c");
|
||||
// Explicitly link the shim library
|
||||
println!("cargo:rustc-link-lib=static=memset_shim");
|
||||
}
|
||||
|
||||
tauri_build::build()
|
||||
|
||||
@ -6,7 +6,13 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
void memset_explicit(void *dest, int val, size_t n) {
|
||||
#ifdef _WIN32
|
||||
#define EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define EXPORT
|
||||
#endif
|
||||
|
||||
EXPORT void memset_explicit(void *dest, int val, size_t n) {
|
||||
volatile unsigned char *p = (volatile unsigned char *)dest;
|
||||
while (n--) {
|
||||
*p++ = (unsigned char)val;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user