summaryrefslogtreecommitdiff
path: root/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-build.patch
blob: edad05a21e64f77f66b30af6bdd1b3e545dd5356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
https://github.com/DennisHeimbigner/netcdf-c/commit/6f86660da86f279cad1f2804cf3242767de27630.patch
https://github.com/Unidata/netcdf-c/issues/1687
https://bugs.gentoo.org/772863

From 6f86660da86f279cad1f2804cf3242767de27630 Mon Sep 17 00:00:00 2001
From: Dennis Heimbigner <dmh@ucar.edu>
Date: Fri, 3 Apr 2020 20:15:34 -0600
Subject: [PATCH] Fix missing forward declarations

re: issue https://github.com/Unidata/netcdf-c/issues/1687

static functions are being used before decl and it causes
errors. Only occurs when BIG_ENDIAN is defined.
Solution is to add the forward declarations.
---
 libdispatch/dfilter.c       | 4 ++++
 nc_test4/tst_filterparser.c | 5 +++++
 plugins/H5Zutil.c           | 1 +
 3 files changed, 10 insertions(+)

diff --git a/libdispatch/dfilter.c b/libdispatch/dfilter.c
index 893846457..0e490a3d6 100644
--- a/libdispatch/dfilter.c
+++ b/libdispatch/dfilter.c
@@ -40,6 +40,10 @@ Unified filter related code
 
 /* Forward */
 static int gettype(const int q0, const int q1, int* unsignedp);
+#ifdef WORDS_BIGENDIAN
+static void byteswap8(unsigned char* mem);
+static void byteswap4(unsigned char* mem);
+#endif
 
 const struct LegalFormat {
     const char* tag;
diff --git a/nc_test4/tst_filterparser.c b/nc_test4/tst_filterparser.c
index 7d02f2bc7..b32094a25 100644
--- a/nc_test4/tst_filterparser.c
+++ b/nc_test4/tst_filterparser.c
@@ -122,6 +122,11 @@ static const char* spectype[] = {"i", "b", "ub", "s", "us", "i", "ui", "i", "i",
 
 static int nerrs = 0;
 
+#ifdef WORDS_BIGENDIAN
+static void byteswap8(unsigned char* mem);
+static void byteswap4(unsigned char* mem);
+#endif
+
 static void
 mismatch(size_t i, unsigned int *params, const char* tag)
 {
diff --git a/plugins/H5Zutil.c b/plugins/H5Zutil.c
index cb36dc96c..86dfb0cfa 100644
--- a/plugins/H5Zutil.c
+++ b/plugins/H5Zutil.c
@@ -4,6 +4,7 @@
  */
 
 
+#include "config.h"
 #include <hdf5.h>
 
 /*