diff --git a/ANNOUNCE b/ANNOUNCE index f50c39a2f..c225002f9 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -759,6 +759,7 @@ Version 1.7.0beta57 [March 16, 2015] Version 1.7.0beta58 [March 21, 2015] Implemented assert support and usage. + Made assert (and impossible) removeable by defining NDEBUG. Remove pnglibconf.dfn and pnglibconf.pre with "make clean". Send comments/corrections/commendations to png-mng-implement at lists.sf.net diff --git a/CHANGES b/CHANGES index 7bc64abd9..4602eda08 100644 --- a/CHANGES +++ b/CHANGES @@ -5049,6 +5049,7 @@ Version 1.7.0beta57 [March 16, 2015] Version 1.7.0beta58 [March 21, 2015] Implemented assert support and usage. + Made assert (and impossible) removeable by defining NDEBUG. Remove pnglibconf.dfn and pnglibconf.pre with "make clean". Send comments/corrections/commendations to png-mng-implement at lists.sf.net diff --git a/pngpriv.h b/pngpriv.h index eddcab802..56299bb9e 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -332,6 +332,7 @@ # define PNG_DLL_EXPORT #endif +#ifndef NDEBUG /* The assert mechanism results in a minimal png_error in released versions * ('STABLE' versions) and a more descriptive abort in all other cases. * The macros rely on the naming convention throughout this code - png_ptr @@ -441,6 +442,28 @@ PNG_apply(arm_arm_init)\ PNG_apply(arm_filter_neon_intrinsics)\ PNG_end +#else +# define assert(cond) +# define impossible(cond) +# define png_impossiblepp(pp, cond) +# define PNG_SRC_FILE_png +# define PNG_SRC_FILE_pngerror +# define PNG_SRC_FILE_pngget +# define PNG_SRC_FILE_pngmem +# define PNG_SRC_FILE_pngpread +# define PNG_SRC_FILE_pngread +# define PNG_SRC_FILE_pngrio +# define PNG_SRC_FILE_pngrtran +# define PNG_SRC_FILE_pngrutil +# define PNG_SRC_FILE_pngset +# define PNG_SRC_FILE_pngtrans +# define PNG_SRC_FILE_pngwio +# define PNG_SRC_FILE_pngwrite +# define PNG_SRC_FILE_pngwtran +# define PNG_SRC_FILE_pngwutil +# define PNG_SRC_FILE_arm_arm_init +# define PNG_SRC_FILE_arm_filter_neon_intrinsics +#endif /* NDEBUG */ /* SECURITY and SAFETY: *