From ad5cac8975b2829b720f458fb817ff1c06a34857 Mon Sep 17 00:00:00 2001 From: Po-Chuan Hsieh Date: Mon, 17 Feb 2025 16:21:25 +0800 Subject: [PATCH] science/minc2: Fix build with netcdf 4.9.3+ Reference: https://github.com/Unidata/netcdf-c/commit/73b9f1828ebdf2e08f328eb24200f881fd4a5214 Approved by: portmgr (blanket) --- science/minc2/files/patch-netcdf | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 science/minc2/files/patch-netcdf diff --git a/science/minc2/files/patch-netcdf b/science/minc2/files/patch-netcdf new file mode 100644 index 000000000000..139ba5217a0c --- /dev/null +++ b/science/minc2/files/patch-netcdf @@ -0,0 +1,42 @@ +--- progs/mincdump/mincdump.c.orig 2012-09-24 17:35:36 UTC ++++ progs/mincdump/mincdump.c +@@ -494,17 +494,17 @@ do_ncdump(char *path, struct fspec* specp) + /* get _FillValue attribute */ + old_nc_opts = ncopts; + ncopts = 0; +- nc_status = ncattinq(ncid,varid,_FillValue,&att.type,&att.len); ++ nc_status = ncattinq(ncid,varid,NC_FillValue,&att.type,&att.len); + ncopts = old_nc_opts; + if(nc_status == NC_NOERR && + att.type == var.type && att.len == 1) { + if(var.type == NC_CHAR) { + char fillc; +- ncattget(ncid, varid, _FillValue, &fillc ); ++ ncattget(ncid, varid, NC_FillValue, &fillc ); + var.fillval = fillc; + } + else { +- ncattget(ncid, varid, _FillValue, &var.fillval); ++ ncattget(ncid, varid, NC_FillValue, &var.fillval); + } + } else { + switch (var.type) { +--- progs/mincgen/ncgentab.y.orig 2012-09-24 17:35:36 UTC ++++ progs/mincgen/ncgentab.y +@@ -288,14 +288,14 @@ attdecl: att + /* shrink space down to what was really needed */ + att_space = erealloc(att_space, valnum*nctypesize(valtype)); + atts[natts].val = att_space; +- if (STREQ(atts[natts].name, _FillValue) && ++ if (STREQ(atts[natts].name, NC_FillValue) && + atts[natts].var != NC_GLOBAL) { + nc_putfill(atts[natts].type, + atts[natts].val, + &vars[atts[natts].var].fill_value); + if(atts[natts].type != vars[atts[natts].var].type) { + derror("variable %s: %s type mismatch", +- vars[atts[natts].var].name, _FillValue); ++ vars[atts[natts].var].name, NC_FillValue); + } + } + natts++;