From d0f71f4eba33440adf5b4dcb910c7553a5a680cd Mon Sep 17 00:00:00 2001
From: Daniel Tipping <daniel@oldreliable.tech>
Date: Fri, 12 Apr 2019 18:37:22 +0100
Subject: [PATCH] Windows: define PROJ_MSVC_DLL_IMPORT

---
 src/common/MatrixHandler.h                | 5 +++++
 src/common/Proj4Projection.h              | 6 ++++++
 src/decoders/GeoPointsDecoder.h           | 5 +++++
 src/decoders/NetcdfGeoMatrixInterpretor.h | 5 +++++
 4 files changed, 21 insertions(+)

diff --git a/src/common/MatrixHandler.h b/src/common/MatrixHandler.h
index e3651ff..62c1fcb 100644
--- a/src/common/MatrixHandler.h
+++ b/src/common/MatrixHandler.h
@@ -473,6 +473,11 @@ public:
 protected:
 };
 
+#include "magics_windef.h"
+#ifdef MAGICS_ON_WINDOWS
+#define PROJ_MSVC_DLL_IMPORT 1
+#endif
+
 #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
 #include <proj_api.h>
 
diff --git a/src/common/Proj4Projection.h b/src/common/Proj4Projection.h
index 30ae383..4f08c4c 100644
--- a/src/common/Proj4Projection.h
+++ b/src/common/Proj4Projection.h
@@ -22,6 +22,12 @@
 #include <Proj4ProjectionAttributes.h>
 #include <Transformation.h>
 #include <XmlNode.h>
+
+#include "magics_windef.h"
+#ifdef MAGICS_ON_WINDOWS
+#define PROJ_MSVC_DLL_IMPORT 1
+#endif
+
 #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
 #include <proj_api.h>
 
diff --git a/src/decoders/GeoPointsDecoder.h b/src/decoders/GeoPointsDecoder.h
index cadaf62..d37e4f7 100644
--- a/src/decoders/GeoPointsDecoder.h
+++ b/src/decoders/GeoPointsDecoder.h
@@ -24,6 +24,11 @@
 
 #include "magics.h"
 
+#include "magics_windef.h"
+#ifdef MAGICS_ON_WINDOWS
+#define PROJ_MSVC_DLL_IMPORT 1
+#endif
+
 #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
 #include <proj_api.h>
 #include "Data.h"
diff --git a/src/decoders/NetcdfGeoMatrixInterpretor.h b/src/decoders/NetcdfGeoMatrixInterpretor.h
index d26ef28..449702a 100644
--- a/src/decoders/NetcdfGeoMatrixInterpretor.h
+++ b/src/decoders/NetcdfGeoMatrixInterpretor.h
@@ -24,6 +24,11 @@
 
 #include "magics.h"
 
+#include "magics_windef.h"
+#ifdef MAGICS_ON_WINDOWS
+#define PROJ_MSVC_DLL_IMPORT 1
+#endif
+
 #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
 #include <proj_api.h>
 #include "Matrix.h"
-- 
2.19.1

