diff --git a/tests/test_opus_decode.c b/tests/test_opus_decode.c
index 2c6a872ad345fe5d5d863e2908de972f7f378aa3..868869b9e63e8167a9217ccc595885fb9861f744 100644
--- a/tests/test_opus_decode.c
+++ b/tests/test_opus_decode.c
@@ -38,6 +38,9 @@
 #include <time.h>
 #if (!defined WIN32 && !defined _WIN32) || defined(__MINGW32__)
 #include <unistd.h>
+#else
+#include <process.h>
+#define getpid _getpid
 #endif
 #include "opus.h"
 #include "test_opus_common.h"
diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c
index 01534fa8dd28d0bf777848771693e79de824fd95..a9a1c58b0a32eda2f2837f34baa513f711af2907 100644
--- a/tests/test_opus_encode.c
+++ b/tests/test_opus_encode.c
@@ -38,6 +38,9 @@
 #include <time.h>
 #if (!defined WIN32 && !defined _WIN32) || defined(__MINGW32__)
 #include <unistd.h>
+#else
+#include <process.h>
+#define getpid _getpid
 #endif
 #include "opus_multistream.h"
 #include "opus.h"
diff --git a/win32/config.h b/win32/config.h
index 6d32620f70019d68317ff1208410c9ecebd3d376..d46d0d5483451917546df40497d499c9773fd35d 100644
--- a/win32/config.h
+++ b/win32/config.h
@@ -4,7 +4,6 @@
 #define CELT_BUILD            1
 
 #define inline __inline
-#define getpid _getpid
 
 #define USE_ALLOCA            1