From 662ae9bb1800fe5d700b7a8730b6cc501cc4d48c Mon Sep 17 00:00:00 2001
From: Ralph Giles <giles@mozilla.com>
Date: Tue, 23 Oct 2012 13:04:36 -0700
Subject: [PATCH] Include process.h for _getpid on windows.

Previously the test programmes happened to link because _getpid
returns an int, which is the default prototype. Instead, include
the appropriate header to supply a real declaration, fixing the
associated warning.

I moved the getpid->_getpid define to the site of the header
inclusion to make clear what's going on, rather than have it
floating in win32/config.h.
---
 tests/test_opus_decode.c | 3 +++
 tests/test_opus_encode.c | 3 +++
 win32/config.h           | 1 -
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/test_opus_decode.c b/tests/test_opus_decode.c
index 2c6a872ad..868869b9e 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 01534fa8d..a9a1c58b0 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 6d32620f7..d46d0d548 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
 
-- 
GitLab