user defined formats only if netcdf-4 is built

This commit is contained in:
Ed Hartnett 2018-05-13 16:03:04 -06:00
parent 048a03fe3d
commit 350946b1e0
6 changed files with 8 additions and 4 deletions

View File

@ -64,6 +64,7 @@ extern int NC_initialized; /**< True when dispatch table is initialized. */
* H5Fis_hdf5, use the complete HDF5 magic number */
static char HDF5_SIGNATURE[MAGIC_NUMBER_LEN] = "\211HDF\r\n\032\n";
#ifdef USE_NETCDF4
/* User-defined formats. */
NC_Dispatch* UF0_dispatch_table = NULL;
NC_Dispatch* UF1_dispatch_table = NULL;
@ -99,6 +100,7 @@ nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_numbe
return NC_NOERR;
}
#endif /* USE_NETCDF4 */
/** \defgroup datasets NetCDF File and Data I/O
@ -2224,6 +2226,7 @@ NC_open(const char *path0, int cmode, int basepe, size_t *chunksizehintp,
nullfree(newpath);
}
#ifdef USE_NETCDF4
/* Check for use of user-defined format 0. */
if (cmode & NC_UF0)
{
@ -2241,6 +2244,7 @@ NC_open(const char *path0, int cmode, int basepe, size_t *chunksizehintp,
model = NC_FORMATX_UF1;
dispatcher = UF1_dispatch_table;
}
#endif /* USE_NETCDF4 */
if(model == 0) {
version = 0;

View File

@ -30,7 +30,7 @@ TARGET_LINK_LIBRARIES(nc_test
)
# Some extra stand-alone tests
SET(TESTS t_nc tst_small tst_misc tst_norm tst_names tst_nofill tst_nofill2 tst_nofill3 tst_meta tst_inq_type tst_utf8_validate tst_utf8_phrases tst_global_fillval tst_max_var_dims tst_formats tst_def_var_fill tst_err_enddef tst_udf)
SET(TESTS t_nc tst_small tst_misc tst_norm tst_names tst_nofill tst_nofill2 tst_nofill3 tst_meta tst_inq_type tst_utf8_validate tst_utf8_phrases tst_global_fillval tst_max_var_dims tst_formats tst_def_var_fill tst_err_enddef)
IF(NOT HAVE_BASH)
SET(TESTS ${TESTS} tst_atts3)

View File

@ -19,7 +19,7 @@ TEST_EXTENSIONS = .sh
TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names \
tst_nofill tst_nofill2 tst_nofill3 tst_atts3 tst_meta tst_inq_type \
tst_utf8_validate tst_utf8_phrases tst_global_fillval \
tst_max_var_dims tst_formats tst_def_var_fill tst_err_enddef tst_udf
tst_max_var_dims tst_formats tst_def_var_fill tst_err_enddef
if USE_PNETCDF
TESTPROGRAMS += tst_parallel2 tst_pnetcdf tst_addvar tst_formatx_pnetcdf

View File

@ -10,7 +10,7 @@ SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4
tst_files6 tst_sync tst_h_strbug tst_h_refs tst_h_scalar tst_rename
tst_rename2 tst_h5_endians tst_atts_string_rewrite tst_put_vars_two_unlim_dim
tst_hdf5_file_compat tst_fill_attr_vanish tst_rehash tst_types tst_bug324
tst_filterparser tst_atts3 tst_put_vars tst_elatefill)
tst_filterparser tst_atts3 tst_put_vars tst_elatefill tst_udf)
# Note, renamegroup needs to be compiled before run_grp_rename

View File

@ -30,7 +30,7 @@ t_type cdm_sea_soundings tst_camrun tst_vl tst_atts1 tst_atts2 \
tst_vars2 tst_files5 tst_files6 tst_sync tst_h_scalar tst_rename \
tst_rename2 tst_h5_endians tst_atts_string_rewrite \
tst_hdf5_file_compat tst_fill_attr_vanish tst_rehash tst_filterparser \
tst_bug324 tst_types tst_atts3 tst_put_vars tst_elatefill
tst_bug324 tst_types tst_atts3 tst_put_vars tst_elatefill tst_udf
# Temporary I hope
if !ISCYGWIN