Skip to content

Commit ef20bd4

Browse files
committed
rt: Make valgrind Win64-compatible
1 parent 05b6a2f commit ef20bd4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/rt/vg/valgrind.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
#undef PLAT_x86_darwin
112112
#undef PLAT_amd64_darwin
113113
#undef PLAT_x86_win32
114+
#undef PLAT_amd64_win64
114115
#undef PLAT_x86_linux
115116
#undef PLAT_amd64_linux
116117
#undef PLAT_ppc32_linux
@@ -125,7 +126,11 @@
125126
# define PLAT_amd64_darwin 1
126127
#elif defined(__MINGW32__) || defined(__CYGWIN32__) \
127128
|| (defined(_WIN32) && defined(_M_IX86))
128-
# define PLAT_x86_win32 1
129+
# if defined(__x86_64__)
130+
# define PLAT_amd64_win64 1
131+
# elif defined(__i386__)
132+
# define PLAT_x86_win32 1
133+
# endif
129134
#elif defined(__linux__) && defined(__i386__)
130135
# define PLAT_x86_linux 1
131136
#elif defined(__linux__) && defined(__x86_64__)
@@ -349,7 +354,8 @@ valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request,
349354

350355
/* ------------------------ amd64-{linux,darwin} --------------- */
351356

352-
#if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin)
357+
#if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin) \
358+
|| defined(PLAT_amd64_win64)
353359

354360
typedef
355361
struct {
@@ -3716,14 +3722,14 @@ VALGRIND_PRINTF(const char *format, ...)
37163722
#if defined(NVALGRIND)
37173723
return 0;
37183724
#else /* NVALGRIND */
3719-
#if defined(_MSC_VER)
3725+
#if defined(_MSC_VER) || defined(PLAT_amd64_win64)
37203726
uintptr_t _qzz_res;
37213727
#else
37223728
unsigned long _qzz_res;
37233729
#endif
37243730
va_list vargs;
37253731
va_start(vargs, format);
3726-
#if defined(_MSC_VER)
3732+
#if defined(_MSC_VER) || defined(PLAT_amd64_win64)
37273733
_qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
37283734
VG_USERREQ__PRINTF_VALIST_BY_REF,
37293735
(uintptr_t)format,
@@ -3754,14 +3760,14 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
37543760
#if defined(NVALGRIND)
37553761
return 0;
37563762
#else /* NVALGRIND */
3757-
#if defined(_MSC_VER)
3763+
#if defined(_MSC_VER) || defined(PLAT_amd64_win64)
37583764
uintptr_t _qzz_res;
37593765
#else
37603766
unsigned long _qzz_res;
37613767
#endif
37623768
va_list vargs;
37633769
va_start(vargs, format);
3764-
#if defined(_MSC_VER)
3770+
#if defined(_MSC_VER) || defined(PLAT_amd64_win64)
37653771
_qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
37663772
VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
37673773
(uintptr_t)format,

0 commit comments

Comments
 (0)