aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosmin Truta <ctruta@gmail.com>2024-01-12 01:12:08 +0200
committerCosmin Truta <ctruta@gmail.com>2024-01-12 01:12:08 +0200
commit6b241f3786685fbe63cf20906ab2019980869217 (patch)
tree07d0c11630d93cff0996b12e715c2f1eafc01ecb
parentb3521c60af03d8adcc5f3b0f6b6555e71315586a (diff)
downloadlibpng-6b241f3786685fbe63cf20906ab2019980869217.tar.gz
Do not rely on `INT_MAX` in png.h
At a certain step in the configuration process, `gcc -Wundef` complained about using `INT_MAX` without a definition in png.h, which is easily fixable with an include. We would rather not add any extra dependencies to png.h, however, so we use some unsigned int arithmetic magic instead.
-rw-r--r--png.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/png.h b/png.h
index f0f456057..eaee5a372 100644
--- a/png.h
+++ b/png.h
@@ -849,7 +849,7 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */
/* Added to libpng-1.5.4 */
#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */
-#if INT_MAX >= 0x8000 /* else this might break */
+#if ~0U > 0xffffU /* or else this might break on a 16-bit machine */
#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */
#endif