Replace finite with isfinite and include math header.
https://github.com/neurodroid/stimfit/commit/fb2fa2b1f8701d04bbaf2ec0902fb0e9289b334e
https://github.com/neurodroid/stimfit/commit/e7561b9277e24fbbf6766b696f4cc6e46422844e
--- src/libbiosiglite/biosig4c++/t210/sopen_heka_read.c.orig
+++ src/libbiosiglite/biosig4c++/t210/sopen_heka_read.c
@@ -24,6 +24,7 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
 #ifdef _WIN32
 // Can't include sys/stat.h or sopen is declared twice.
 #include <sys/types.h>
@@ -71,7 +72,7 @@ void rational (double x, double tol, long *n, long *d) {
                 return;
         }
 
-	if (!finite(x)) {
+	if (!isfinite(x)) {
 	        *n = x>0; 	// i.e. sign(x)
                 *d = 0;
                 return;
--- src/libstfnum/levmar/compiler.h.orig
+++ src/libstfnum/levmar/compiler.h
@@ -33,9 +33,9 @@
 #ifdef _MSC_VER
 #define LM_FINITE _finite // MSVC
 #elif defined(__ICC) || defined(__INTEL_COMPILER) || defined(__GNUC__)
-#define LM_FINITE finite // ICC, GCC
+#define LM_FINITE isfinite // ICC, GCC
 #else
-#define LM_FINITE finite // other than MSVC, ICC, GCC, let's hope this will work
+#define LM_FINITE isfinite // other than MSVC, ICC, GCC, let's hope this will work
 #endif
 
 #ifdef _MSC_VER
