diff --git a/numpy/random/src/mt19937/mt19937.h b/numpy/random/src/mt19937/mt19937.h
index 1b39e0b..8312933 100644
--- a/numpy/random/src/mt19937/mt19937.h
+++ b/numpy/random/src/mt19937/mt19937.h
@@ -2,7 +2,7 @@
 #include <math.h>
 #include <stdint.h>
 
-#ifdef _WIN32
+#if defined(_WIN32) && !defined (__MINGW32__)
 #define inline __forceinline
 #endif
 
diff --git a/numpy/random/src/pcg64/pcg64.h b/numpy/random/src/pcg64/pcg64.h
index 2a7217d..1c607f5 100644
--- a/numpy/random/src/pcg64/pcg64.h
+++ b/numpy/random/src/pcg64/pcg64.h
@@ -52,7 +52,7 @@
 
 #include <inttypes.h>
 
-#ifdef _WIN32
+#if defined(_WIN32) && !defined (__MINGW32__)
 #include <stdlib.h>
 #define inline __forceinline
 #endif
diff --git a/numpy/random/src/philox/philox.h b/numpy/random/src/philox/philox.h
index c72424a..8e7b0ff 100644
--- a/numpy/random/src/philox/philox.h
+++ b/numpy/random/src/philox/philox.h
@@ -33,7 +33,7 @@ static NPY_INLINE uint64_t mulhilo64(uint64_t a, uint64_t b, uint64_t *hip) {
   return (uint64_t)product;
 }
 #else
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__MINGW32__)
 #include <intrin.h>
 #if defined(_WIN64) && defined(_M_AMD64)
 #pragma intrinsic(_umul128)
