diff --git a/tests/src/hipEnvVar.cpp b/tests/src/hipEnvVar.cpp index 7c261b1fa3..a0b9503b41 100644 --- a/tests/src/hipEnvVar.cpp +++ b/tests/src/hipEnvVar.cpp @@ -31,14 +31,7 @@ THE SOFTWARE. #include "clara/clara.hpp" #include #include "hip/hip_runtime.h" - -#ifdef _WIN64 -#include -#endif - -#ifdef _WIN64 -#define setenv(x,y,z) _putenv_s(x,y) -#endif +#include "test_common.h" using namespace std; using namespace clara; diff --git a/tests/src/hipEnvVarDriver.cpp b/tests/src/hipEnvVarDriver.cpp index 37e51faa31..4817d157a4 100644 --- a/tests/src/hipEnvVarDriver.cpp +++ b/tests/src/hipEnvVarDriver.cpp @@ -30,13 +30,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA #include "hip/hip_runtime.h" #include #include - -#ifdef _WIN64 -#define popen(x,y) _popen(x,y) -#define pclose(x) _pclose(x) -#define setenv(x,y,z) _putenv_s(x,y) -#define unsetenv(x) _putenv_s(x,"") -#endif +#include "test_common.h" using namespace std; diff --git a/tests/src/runtimeApi/memory/hipMemcpy_simple.cpp b/tests/src/runtimeApi/memory/hipMemcpy_simple.cpp index dcec1fd834..8ce02d6164 100644 --- a/tests/src/runtimeApi/memory/hipMemcpy_simple.cpp +++ b/tests/src/runtimeApi/memory/hipMemcpy_simple.cpp @@ -29,9 +29,6 @@ THE SOFTWARE. #include "hip/hip_runtime.h" #include "test_common.h" -#ifdef _WIN64 -#define aligned_alloc _aligned_malloc -#endif bool p_async = false; diff --git a/tests/src/runtimeApi/memory/hipMemoryAllocateCoherentDriver.cpp b/tests/src/runtimeApi/memory/hipMemoryAllocateCoherentDriver.cpp index a064a6ad0a..b9d7602039 100644 --- a/tests/src/runtimeApi/memory/hipMemoryAllocateCoherentDriver.cpp +++ b/tests/src/runtimeApi/memory/hipMemoryAllocateCoherentDriver.cpp @@ -29,12 +29,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA #include #include #include "hip/hip_runtime.h" - -#ifdef _WIN64 -#define popen(x,y) _popen(x,y) -#define pclose(x) _pclose(x) -#define setenv(x,y,z) _putenv_s(x,y) -#endif +#include "test_common.h" using namespace std; diff --git a/tests/src/test_common.h b/tests/src/test_common.h index 8820381826..78aa845076 100644 --- a/tests/src/test_common.h +++ b/tests/src/test_common.h @@ -95,6 +95,14 @@ THE SOFTWARE. } \ } +#ifdef _WIN64 +#include +#define aligned_alloc _aligned_malloc +#define popen(x,y) _popen(x,y) +#define pclose(x) _pclose(x) +#define setenv(x,y,z) _putenv_s(x,y) +#endif + // standard command-line variables: extern size_t N; extern char memsetval;