more magic numbers

This commit is contained in:
Ed Hartnett 2018-06-06 12:54:03 -06:00
parent 0dcdf7198f
commit c172acab98
2 changed files with 26 additions and 1 deletions

View File

@ -587,6 +587,14 @@ if test -n "$UDF0_DISPATCH"; then
[])
fi
# Did the user specify a magic number for user-defined format 0?
AC_MSG_CHECKING([whether a magic number for user-defined format 0 was specified])
AC_ARG_WITH([udf0-magic-number],
[AS_HELP_STRING([--with-udf0-magic-number=<magic_number>],
[Specify a magic number for user-defined format 0 (ignored unless --with-udf0 is also used).])],
[UDF0_MAGIC_NUMBER=$with_udf0_magic_number])
AC_MSG_RESULT([$UDF0_MAGIC_NUMBER])
# Did the user specify a user-defined format 1?
AC_MSG_CHECKING([whether user-defined format 1 was specified])
AC_ARG_WITH([udf1],
@ -603,6 +611,14 @@ if test -n "$UDF1_DISPATCH"; then
[])
fi
# Did the user specify a magic number for user-defined format 0?
AC_MSG_CHECKING([whether a magic number for user-defined format 1 was specified])
AC_ARG_WITH([udf1-magic-number],
[AS_HELP_STRING([--with-udf1-magic-number=<magic_number>],
[Specify a magic number for user-defined format 1 (ignored unless --with-udf1 is also used).])],
[UDF1_MAGIC_NUMBER=$with_udf1_magic_number])
AC_MSG_RESULT([$UDF1_MAGIC_NUMBER])
# Did the user specify a default cache preemption?
AC_MSG_CHECKING([whether a default cache preemption for HDF5 was specified])
AC_ARG_WITH([chunk-cache-preemption],

View File

@ -2292,7 +2292,8 @@ NC_open(const char *path0, int cmode, int basepe, size_t *chunksizehintp,
}
/* Force flag consistentcy */
if(model == NC_FORMATX_NC4 || model == NC_FORMATX_NC_HDF4 || model == NC_FORMATX_DAP4)
if(model == NC_FORMATX_NC4 || model == NC_FORMATX_NC_HDF4 || model == NC_FORMATX_DAP4 ||
model == NC_FORMATX_UDF0 || model == NC_FORMATX_UDF1)
cmode |= NC_NETCDF4;
else if(model == NC_FORMATX_DAP2) {
cmode &= ~NC_NETCDF4;
@ -2358,6 +2359,14 @@ NC_open(const char *path0, int cmode, int basepe, size_t *chunksizehintp,
dispatcher = HDF4_dispatch_table;
break;
#endif
#ifdef USE_NETCDF4
case NC_FORMATX_UDF0:
dispatcher = UDF0_dispatch_table;
break;
case NC_FORMATX_UDF1:
dispatcher = UDF1_dispatch_table;
break;
#endif /* USE_NETCDF4 */
case NC_FORMATX_NC3:
dispatcher = NC3_dispatch_table;
break;