File redsea-mingw-build-fix.patch of Package mingw64-redsea
diff --git a/configure.ac b/configure.ac
index ccdbbdd..e1ec7eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,9 @@ case "${host_os}" in
darwin*)
AC_SUBST([ICONV], ["-liconv"])
;;
+ mingw*)
+ AC_SUBST([ICONV], ["-liconv"])
+ ;;
esac
AC_PROG_CXX
diff --git a/src/Makefile.am b/src/Makefile.am
index 529f8a1..19e6fce 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
bin_PROGRAMS = redsea
-redsea_CPPFLAGS = -std=c++14 -Wall -Wextra -Wstrict-overflow -Wshadow -Wdouble-promotion -Wundef -Wpointer-arith -Wcast-align -Wcast-qual -Wuninitialized -pedantic \
+redsea_CPPFLAGS = -std=c++14 -Wall -Wextra -Wstrict-overflow -Wshadow -Wdouble-promotion -Wundef -Wpointer-arith -Wcast-align -Wcast-qual -Wuninitialized -pedantic -fpermissive \
$(MACPORTS_CF) $(RFLAGS)
-redsea_LDADD = $(MACPORTS_LD) -lc $(LIQUID) $(ICONV) $(SNDFILE)
+redsea_LDADD = $(MACPORTS_LD) $(LIQUID) $(ICONV) $(SNDFILE)
redsea_SOURCES = redsea.cc common.cc input.cc subcarrier.cc block_sync.cc groups.cc \
tables.cc rdsstring.cc tmc/tmc.cc tmc/locationdb.cc util.cc \
channel.cc options.cc liquid_wrappers.cc jsoncpp.cpp
diff --git a/src/subcarrier.cc b/src/subcarrier.cc
index 3eb47fd..4b4cf3f 100644
--- a/src/subcarrier.cc
+++ b/src/subcarrier.cc
@@ -47,6 +47,11 @@ constexpr float kSymsyncBeta = 0.8f;
constexpr float kPLLBandwidth_Hz = 0.01f;
constexpr float kPLLMultiplier = 12.0f;
+// for portability of M_PI (MS Visual Studio, MinGW, etc.)
+#ifndef M_PI
+constexpr double M_PI = 3.14159265358979323846;
+#endif
+
constexpr float hertz2step(float Hz) {
return Hz * 2.0f * float(M_PI) / kTargetSampleRate_Hz;
}