chore: Clean up the error directives

Make the error directives uniformly consistent with one another.
Remove surrounding quotes and trailing punctuation, and rephrase
some of the error messages and some of their associated comments
for either brevity or clarity.
This commit is contained in:
Cosmin Truta 2025-04-25 16:19:30 +03:00
parent c90491724e
commit 69a3e5bfd1
8 changed files with 27 additions and 29 deletions

View File

@ -35,14 +35,14 @@
#ifndef PNG_ARM_NEON_FILE
# if defined(__aarch64__) || defined(_M_ARM64)
/* ARM Neon is expected to be unconditionally available on ARM64. */
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
/* ARM Neon is expected to be available on the target CPU architecture. */
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
# elif defined(__linux__)
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# else
# error "No support for run-time ARM Neon checking; use compile-time options"
# error No support for run-time ARM Neon checking; use compile-time options
# endif
#endif
@ -53,7 +53,7 @@ static int png_have_neon(png_structp png_ptr);
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
void

View File

@ -32,7 +32,7 @@
#endif
#if PNG_LIBPNG_VER < 10603 /* 1.6.3 */
# error "pngfix will not work with libpng prior to 1.6.3"
# error pngfix requires libpng version 1.6.3 or newer
#endif
#ifdef PNG_SETJMP_SUPPORTED
@ -68,7 +68,7 @@
#endif
#ifndef PNG_MAXIMUM_INFLATE_WINDOW
# error "pngfix not supported in this libpng version"
# error pngfix requires libpng with PNG_MAXIMUM_INFLATE_WINDOW supported
#endif
#if ZLIB_VERNUM >= 0x1240

View File

@ -48,7 +48,7 @@ static int png_have_msa(png_structp png_ptr);
#include PNG_MIPS_MSA_FILE
#else /* PNG_MIPS_MSA_FILE */
# error "PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks"
# error PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks
#endif /* PNG_MIPS_MSA_FILE */
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
@ -66,12 +66,12 @@ static int png_have_mmi();
#include PNG_MIPS_MMI_FILE
#else /* PNG_MIPS_MMI_FILE */
# error "PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks"
# error PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks
#endif /* PNG_MIPS_MMI_FILE */
#endif /* PNG_MIPS_MMI_CHECK_SUPPORTED*/
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
/* MIPS supports two optimizations: MMI and MSA. The appropriate

View File

@ -219,7 +219,7 @@
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
# endif
# define PNG_DLL_EXPORT __declspec(dllexport)
@ -467,7 +467,7 @@
#if CHAR_BIT == 8 && UCHAR_MAX == 255
typedef unsigned char png_byte;
#else
# error "libpng requires 8-bit bytes"
# error libpng requires 8-bit bytes
#endif
#if INT_MIN == -32768 && INT_MAX == 32767
@ -475,7 +475,7 @@
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
typedef short png_int_16;
#else
# error "libpng requires a signed 16-bit type"
# error libpng requires a signed 16-bit integer type
#endif
#if UINT_MAX == 65535
@ -483,7 +483,7 @@
#elif USHRT_MAX == 65535
typedef unsigned short png_uint_16;
#else
# error "libpng requires an unsigned 16-bit type"
# error libpng requires an unsigned 16-bit integer type
#endif
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
@ -491,7 +491,7 @@
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
typedef long int png_int_32;
#else
# error "libpng requires a signed 32-bit (or more) type"
# error libpng requires a signed 32-bit (or longer) integer type
#endif
#if UINT_MAX > 4294967294U
@ -499,7 +499,7 @@
#elif ULONG_MAX > 4294967294U
typedef unsigned long int png_uint_32;
#else
# error "libpng requires an unsigned 32-bit (or more) type"
# error libpng requires an unsigned 32-bit (or longer) integer type
#endif
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.

View File

@ -1000,17 +1000,15 @@
* must match that used in the build, or we must be using pnglibconf.h.prebuilt:
*/
#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
"-I (include path) error: see the notes in pngpriv.h"
/* This means that when pnglibconf.h was built the copy of zlib.h that it
* used is not the same as the one being used here. Because the build of
* libpng makes decisions to use inflateInit2 and inflateReset2 based on the
* zlib version number and because this affects handling of certain broken
* PNG files the -I directives must match.
# error The include path of <zlib.h> is incorrect
/* When pnglibconf.h was built, the copy of zlib.h that it used was not the
* same as the one being used here. Considering how libpng makes decisions
* to use the zlib API based on the zlib version number, the -I options must
* match.
*
* The most likely explanation is that you passed a -I in CFLAGS. This will
* not work; all the preprocessor directives and in particular all the -I
* directives must be in CPPFLAGS.
* A possible cause of this mismatch is that you passed an -I option in
* CFLAGS, which is unlikely to work. All the preprocessor options, and all
* the -I options in particular, should be in CPPFLAGS.
*/
#endif

View File

@ -60,7 +60,7 @@ typedef png_libpng_version_1_6_48_git Your_png_h_is_not_version_1_6_48_git;
PNG_LIBPNG_VER_MINOR) || \
(PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_SONUM) || \
(PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_DLLNUM)
# error "Inconsistent version numbers in png.h"
# error Inconsistent version numbers in "png.h"
#endif
/* In version 1.6.1, we added support for the configure test harness, which
@ -116,7 +116,7 @@ typedef png_libpng_version_1_6_48_git Your_png_h_is_not_version_1_6_48_git;
# define pngtest_debug1(m, p1) ((void)0)
# define pngtest_debug2(m, p1, p2) ((void)0)
#else /* PNG_DEBUG < 0 */
# error "Bad PNG_DEBUG value"
# error Bad PNG_DEBUG value
#endif
/* Turn on CPU timing

View File

@ -23,7 +23,7 @@
#if PNG_POWERPC_VSX_OPT > 0
#ifndef __VSX__
# error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
# error This code requires VSX support (POWER7 and later); please compile with -mvsx
#endif
#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)

View File

@ -46,7 +46,7 @@ static int png_have_vsx(png_structp png_ptr);
#include PNG_POWERPC_VSX_FILE
#else /* PNG_POWERPC_VSX_FILE */
# error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
# error PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks
#endif /* PNG_POWERPC_VSX_FILE */
#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */