Skip to content

Commit 9a2415b

Browse files
committed
std: Mark rust_get_num_cpus as dllexport
This function is imported across the DLL boundary by the libtest dynamic library, so it has to be marked as dllexport somehow, and for now this is done with an attribute on the function specifically.
1 parent f5222fb commit 9a2415b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rt/rust_builtin.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
#include "valgrind/valgrind.h"
4646
#endif
4747

48+
#if defined(_MSC_VER)
49+
# define RUST_BUILTIN_API __declspec(dllexport)
50+
#else
51+
# define RUST_BUILTIN_API
52+
#endif
53+
4854
#ifndef _WIN32
4955
char*
5056
rust_list_dir_val(struct dirent* entry_ptr) {
@@ -129,6 +135,7 @@ get_num_cpus() {
129135
}
130136
#endif
131137

138+
RUST_BUILTIN_API
132139
uintptr_t
133140
rust_get_num_cpus() {
134141
return get_num_cpus();

0 commit comments

Comments
 (0)