mirror of
https://github.com/decompals/wibo.git
synced 2025-12-12 22:56:13 +00:00
Everything needed to run simple Rust programs (#40)
* Everything needed to run simple Rust programs * Add IsDBCSLeadByte implementation * Address PR comments
This commit is contained in:
31
dll/vcruntime.cpp
Normal file
31
dll/vcruntime.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "common.h"
|
||||
|
||||
namespace vcruntime {
|
||||
|
||||
void *WIN_ENTRY memcpy(void *dest, const void *src, size_t count) { return ::memcpy(dest, src, count); }
|
||||
|
||||
void *WIN_ENTRY memset(void *dest, int ch, size_t count) { return ::memset(dest, ch, count); }
|
||||
|
||||
int WIN_ENTRY memcmp(const void *buf1, const void *buf2, size_t count) { return ::memcmp(buf1, buf2, count); }
|
||||
|
||||
} // namespace vcruntime
|
||||
|
||||
static void *resolveByName(const char *name) {
|
||||
if (strcmp(name, "memcpy") == 0)
|
||||
return (void *)vcruntime::memcpy;
|
||||
if (strcmp(name, "memset") == 0)
|
||||
return (void *)vcruntime::memset;
|
||||
if (strcmp(name, "memcmp") == 0)
|
||||
return (void *)vcruntime::memcmp;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
wibo::Module lib_vcruntime = {
|
||||
(const char *[]){
|
||||
"vcruntime140",
|
||||
"vcruntime140.dll",
|
||||
nullptr,
|
||||
},
|
||||
resolveByName,
|
||||
nullptr,
|
||||
};
|
||||
Reference in New Issue
Block a user