* Detect the #define _MSC_VER in addition to __WIN32__
* Don't include valgrind.h for windows
* Remove unused `rust_valgrind_stack_{un,}register` functions
* Add stub definition for `rust_running_on_valgrind` for windows
* Conditionally define `rust_dbg_extern_empty_struct` as empty structures are
not allowed by cl.exe apparently.
#include <assert.h>
#include <stdlib.h>
#include <assert.h>
#include <stdlib.h>
#include <dirent.h>
#include <pthread.h>
#include <signal.h>
#include <dirent.h>
#include <pthread.h>
#include <signal.h>
/* Foreign builtins. */
//include valgrind.h after stdint.h so that uintptr_t is defined for msys2 w64
/* Foreign builtins. */
//include valgrind.h after stdint.h so that uintptr_t is defined for msys2 w64
#include "valgrind/valgrind.h"
#include "valgrind/valgrind.h"
-uintptr_t
-rust_running_on_valgrind() {
- return RUNNING_ON_VALGRIND;
-}
-
-#if defined(__WIN32__)
int
get_num_cpus() {
SYSTEM_INFO sysinfo;
int
get_num_cpus() {
SYSTEM_INFO sysinfo;
-unsigned int
-rust_valgrind_stack_register(void *start, void *end) {
- return VALGRIND_STACK_REGISTER(start, end);
-}
-
-void
-rust_valgrind_stack_deregister(unsigned int id) {
- VALGRIND_STACK_DEREGISTER(id);
+uintptr_t
+rust_running_on_valgrind() {
+#ifdef _WIN32
+ return 0;
+#else
+ return RUNNING_ON_VALGRIND;
+#endif
}
#if defined(__DragonFly__)
}
#if defined(__DragonFly__)
+// MSVC doesn't allow empty structs or unions
+#ifndef _MSC_VER
assert(v1.arg6.one == v2.arg6.one + 1);
assert(v1.arg6.two == v2.arg6.two + 1);
}
assert(v1.arg6.one == v2.arg6.one + 1);
assert(v1.arg6.two == v2.arg6.two + 1);
}
intptr_t
rust_get_test_int() {
intptr_t
rust_get_test_int() {