gentoo/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-test.patch
Sam James 9cc8bb6014
sci-libs/netcdf: fix big endian build/tests
Closes: https://bugs.gentoo.org/772863
Package-Manager: Portage-3.0.15, Repoman-3.0.2
Signed-off-by: Sam James <sam@gentoo.org>
2021-02-25 08:55:47 +00:00

17 lines
689 B
Diff

Fixes ncdump_tst_netcdf4 test failure on big endian.
https://github.com/Unidata/netcdf-c/issues/1896
diff --git a/ncdump/tst_special_atts.c b/ncdump/tst_special_atts.c
index 9655b86..e71cb7e 100644
--- a/ncdump/tst_special_atts.c
+++ b/ncdump/tst_special_atts.c
@@ -145,6 +145,10 @@ main(int argc, char **argv)
/* Set _Storage as compact */
if (nc_def_var_chunking(ncid, var6id, NC_COMPACT, NULL)) ERR;
if (nc_def_var_chunking(ncid, var7id, NC_COMPACT, NULL)) ERR;
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ if (nc_def_var_endian(ncid, var6id, NC_ENDIAN_LITTLE)) ERR;
+ if (nc_def_var_endian(ncid, var7id, NC_ENDIAN_LITTLE)) ERR;
+#endif
if (nc_enddef(ncid)) ERR;