closedcaption: Fix build with Visual Studio
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 11 Mar 2019 09:30:59 +0000 (15:00 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Mon, 11 Mar 2019 09:32:53 +0000 (15:02 +0530)
../ext/closedcaption/io-sim.c(440): error C2065: 'M_PI': undeclared identifier
../ext/closedcaption/io-sim.c(442): error C2065: 'M_LN2': undeclared identifier

ext/closedcaption/io-sim.c

index 8ba58ab..6d54576 100644 (file)
@@ -25,6 +25,9 @@
 #  include "config.h"
 #endif
 
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES       /* Needed for M_PI and M_LN2 */
+#endif
 #include <math.h>               /* sin(), log() */
 #include <errno.h>
 #include <ctype.h>              /* isspace() */