From 342bc860b17fed02faa8ceb01ba90b87f91ab1f3 Mon Sep 17 00:00:00 2001
From: Raffaele Gaetano <raffaele.gaetano@cirad.fr>
Date: Tue, 22 Jun 2021 15:13:18 +0200
Subject: [PATCH] Update to build with mingw gcc 8.1.0

---
 Release/compile.bat | 10 ++++++++++
 src/main.cpp        |  2 +-
 src/rasterstats.h   |  2 +-
 src/rasterstats1d.h |  2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 Release/compile.bat

diff --git a/Release/compile.bat b/Release/compile.bat
new file mode 100644
index 0000000..45efd83
--- /dev/null
+++ b/Release/compile.bat
@@ -0,0 +1,10 @@
+rem MODIFY ACCORDINGLY!
+set PATH=C:\Work\cppdevel\mingw64\bin;C:\Work\gnuwin\bin;%PATH%
+set NUMPY_INCLUDE=C:\Work\moringa-standalone\Python\Lib\site-packages\numpy\core\include\numpy
+set PYTHON_INCLUDE=C:\Work\moringa-standalone\Python\include
+set PYTHON_LIB=python36
+set PYTHON_LIB_PATH=C:\Work\moringa-standalone\Python
+set PYTHON_LD_EXT=pyd
+set PYTHON_LD_INSTALLDIR=C:\Work\moringa-standalone\moringa\sitsproc_c_modules
+set PYTHON_CPY_LINKERFLAGS=
+mingw32-make
diff --git a/src/main.cpp b/src/main.cpp
index bcc77c3..e1208cb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -6,7 +6,7 @@
  */
 
 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-
+#define _hypot hypot
 #include "Python.h"
 #if PY_MAJOR_VERSION >= 3
 #define PY3K
diff --git a/src/rasterstats.h b/src/rasterstats.h
index 7f08acb..14425c3 100644
--- a/src/rasterstats.h
+++ b/src/rasterstats.h
@@ -30,7 +30,7 @@
 #include <map>
 
 //DEBUG
-#include <Python.h>
+//#include <Python.h>
 //-----
 
 using namespace std;
diff --git a/src/rasterstats1d.h b/src/rasterstats1d.h
index da7611d..e08103e 100644
--- a/src/rasterstats1d.h
+++ b/src/rasterstats1d.h
@@ -30,7 +30,7 @@
 #include <map>
 
 //DEBUG
-#include <Python.h>
+//#include <Python.h>
 //-----
 
 using namespace std;
-- 
GitLab