File 419f09aebd2f9219f88853ca6d85c3458f208bf1.patch of Package wgrib2

From 419f09aebd2f9219f88853ca6d85c3458f208bf1 Mon Sep 17 00:00:00 2001
From: Manfred Schwarb <11859839+manfredsc@users.noreply.github.com>
Date: Thu, 22 May 2025 15:13:52 +0200
Subject: [PATCH] Fix include order so macro variables set in config.h are
 actually be included via wgrib2.h before they are used.

---
 wgrib2/Grib.c        | 5 +++--
 wgrib2/ffopen.c      | 3 +--
 wgrib2/rd_seq_grib.c | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/wgrib2/Grib.c b/wgrib2/Grib.c
index 0ece42cc..4b78b62f 100644
--- a/wgrib2/Grib.c
+++ b/wgrib2/Grib.c
@@ -4,11 +4,12 @@
 #include <math.h>
 #include <limits.h>
 #include "grb2.h"
+#include "wgrib2.h"
+#include "fnlist.h"
+
 #ifdef USE_G2CLIB_LOW
 #include <grib2.h>
 #endif
-#include "wgrib2.h"
-#include "fnlist.h"
 
 /*
  * Grib_out
diff --git a/wgrib2/ffopen.c b/wgrib2/ffopen.c
index 15782572..7ccf4133 100644
--- a/wgrib2/ffopen.c
+++ b/wgrib2/ffopen.c
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "wgrib2.h"
 
 #ifndef DISABLE_STAT
 #include <sys/types.h>
@@ -8,8 +9,6 @@
 #include <unistd.h>
 #endif
 
-#include "wgrib2.h"
-
 /*
  * a simple extension to fopen
  *
diff --git a/wgrib2/rd_seq_grib.c b/wgrib2/rd_seq_grib.c
index 11d8f4f1..c4723f98 100644
--- a/wgrib2/rd_seq_grib.c
+++ b/wgrib2/rd_seq_grib.c
@@ -5,6 +5,9 @@
 #include <math.h>
 #include <float.h>
 
+#include "grb2.h"
+#include "wgrib2.h"
+
 /* rd_seq_grib.c   10/2024   Public Domain Wesley Ebisuzaki
  *
  * two ways to read a grib file
@@ -28,9 +31,6 @@
 #include <fcntl.h>
 #endif
 
-#include "grb2.h"
-#include "wgrib2.h"
-
 /*
  * rd_grib2_msg_seq_file.c *                              Wesley Ebisuzaki
  *
openSUSE Build Service is sponsored by