diff --git a/include/share/compat.h b/include/share/compat.h
index 6218b59..bd4285b 100644
--- a/include/share/compat.h
+++ b/include/share/compat.h
@@ -177,8 +177,11 @@
 #ifndef M_LN2
 #define M_LN2 0.69314718055994530942
 #endif
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
 
-/* FLAC needs to compile and work correctly on systems with a norrmal ISO C99
+/* FLAC needs to compile and work correctly on systems with a normal ISO C99
  * snprintf as well as Microsoft Visual Studio which has an non-standards
  * conformant snprint_s function.
  *
diff --git a/src/libFLAC/window.c b/src/libFLAC/window.c
index 70adb74..3a0fd98 100644
--- a/src/libFLAC/window.c
+++ b/src/libFLAC/window.c
@@ -35,17 +35,13 @@
 #endif
 
 #include <math.h>
+#include "share/compat.h"
 #include "FLAC/assert.h"
 #include "FLAC/format.h"
 #include "private/window.h"
 
 #ifndef FLAC__INTEGER_ONLY_LIBRARY
 
-#ifndef M_PI
-/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */
-#define M_PI 3.14159265358979323846
-#endif
-
 
 void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L)
 {
diff --git a/src/test_streams/main.c b/src/test_streams/main.c
index b124250..7bcac9b 100644
--- a/src/test_streams/main.c
+++ b/src/test_streams/main.c
@@ -34,11 +34,6 @@
 #include "FLAC/ordinals.h"
 #include "share/compat.h"
 
-#ifndef M_PI
-/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */
-#define M_PI 3.14159265358979323846
-#endif
-
 #if !defined _MSC_VER && !defined __MINGW32__
 #define GET_RANDOM_BYTE (((unsigned)random()) & 0xff)
 #else
