Skip to content

Commit 6d4935a

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 0cbc93f commit 6d4935a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rt/rust_builtin.c

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
#include "valgrind/valgrind.h"
5050
#endif
5151

52+
#if defined(_MSC_VER)
53+
# define RUST_BUILTIN_API __declspec(dllexport)
54+
#else
55+
# define RUST_BUILTIN_API
56+
#endif
57+
5258
#ifndef WINDOWS
5359
char*
5460
rust_list_dir_val(struct dirent* entry_ptr) {
@@ -133,6 +139,7 @@ get_num_cpus() {
133139
}
134140
#endif
135141

142+
RUST_BUILTIN_API
136143
uintptr_t
137144
rust_get_num_cpus() {
138145
return get_num_cpus();

0 commit comments

Comments
 (0)