Control: tags -1 patch

On 2/21/21 7:23 AM, Bas Couwenberg wrote:
> Your package FTBFS with PROJ 8.0.0:
> 
>  /usr/include/proj.h:345:23: error: type alias redefinition with different 
> types ('struct pj_ctx' vs 'struct projCtx_t') [clang-diagnostic-error]
>  typedef struct pj_ctx PJ_CONTEXT;
>                        ^
>  
> /home/bas/tmp/debian/atlas-ecmwf-0.23.0/src/atlas/projection/detail/ProjProjection.h:23:7:
>  note: previous definition is here
>  using PJ_CONTEXT = struct projCtx_t;
>        ^
>  2156 warnings and 1 error generated.
>  Error while processing 
> /home/bas/tmp/debian/atlas-ecmwf-0.23.0/src/atlas/projection/detail/ProjProjection.cc.

The attached patch fixes the issue.

It's pretty much the same as the one for magics++ (#983236)

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
--- a/src/atlas/projection/detail/ProjProjection.cc
+++ b/src/atlas/projection/detail/ProjProjection.cc
@@ -9,10 +9,10 @@
  */
 
 
-#include "ProjProjection.h"
-
 #include <proj.h>
 
+#include "ProjProjection.h"
+
 #include "eckit/types/FloatCompare.h"
 #include "eckit/utils/Hash.h"
 
--- a/src/atlas/projection/detail/ProjProjection.h
+++ b/src/atlas/projection/detail/ProjProjection.h
@@ -17,12 +17,14 @@
 #include "atlas/util/Config.h"
 
 
+#if PROJ_VERSION_MAJOR < 8
 extern "C" {
 using PJ = struct PJconsts;
 PJ* proj_destroy( PJ* );
 using PJ_CONTEXT = struct projCtx_t;
 PJ_CONTEXT* proj_context_destroy( PJ_CONTEXT* );
 }
+#endif
 
 
 namespace atlas {

Reply via email to