From d5ad24e39b704525f1f39dd75b2092801c1c6124 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 9 Jun 2015 21:13:36 -0700 Subject: [PATCH] vk: Move the valgrind include and VG() macro to private.h --- src/vulkan/allocator.c | 4 ---- src/vulkan/gem.c | 8 -------- src/vulkan/private.h | 8 ++++++++ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/vulkan/allocator.c b/src/vulkan/allocator.c index 80079ad82e4..8752edac91d 100644 --- a/src/vulkan/allocator.c +++ b/src/vulkan/allocator.c @@ -37,9 +37,6 @@ #include "private.h" #ifdef HAVE_VALGRIND -#include -#include -#define VG(x) x #define VG_NOACCESS_READ(__ptr) ({ \ VALGRIND_MAKE_MEM_DEFINED((__ptr), sizeof(*(__ptr))); \ __typeof(*(__ptr)) __val = *(__ptr); \ @@ -52,7 +49,6 @@ VALGRIND_MAKE_MEM_NOACCESS((__ptr), sizeof(*(__ptr))); \ }) #else -#define VG(x) #define VG_NOACCESS_READ(__ptr) (*(__ptr)) #define VG_NOACCESS_WRITE(__ptr, __val) (*(__ptr) = (__val)) #endif diff --git a/src/vulkan/gem.c b/src/vulkan/gem.c index ab6f5c4dfbd..7bc5e49a810 100644 --- a/src/vulkan/gem.c +++ b/src/vulkan/gem.c @@ -32,14 +32,6 @@ #include "private.h" -#ifdef HAVE_VALGRIND -#include -#include -#define VG(x) x -#else -#define VG(x) -#endif - #define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s))) static int diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 36279fac2cb..84c0524ad3c 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -30,6 +30,14 @@ #include #include +#ifdef HAVE_VALGRIND +#include +#include +#define VG(x) x +#else +#define VG(x) +#endif + #include "brw_device_info.h" #include "util/macros.h" -- 2.30.2