Merge pull request #1326 from NetCDF-World-Domination-Council/ejh_file_name_in_built_files

provide NDEBUG version of macro NC_CHECK which does not use code file name
This commit is contained in:
Ward Fisher 2019-03-08 13:54:53 -07:00 committed by GitHub
commit c0d24c827b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,15 @@ extern char *progname; /* for error messages */
extern "C" {
#endif
/* For NDEBUG builds, provide a version of NC_CHECK that does not
* include a file name. Including a file name causes heartache for the
* debian package builders. They already use NDEBUG to turn off the
* file names in asserts. */
#ifdef NDEBUG
#define NC_CHECK(fncall) {int ncstat=fncall;if(ncstat!=NC_NOERR)check(ncstat,"",__LINE__);}
#else
#define NC_CHECK(fncall) {int ncstat=fncall;if(ncstat!=NC_NOERR)check(ncstat,__FILE__,__LINE__);}
#endif /* NDEBUG */
/* Print error message to stderr and exit */
extern void error ( const char *fmt, ... );