diff options
Diffstat (limited to 'libtiff')
-rw-r--r-- | libtiff/tif_lerc.c | 2 | ||||
-rw-r--r-- | libtiff/tif_open.c | 6 | ||||
-rw-r--r-- | libtiff/tiffconf.h.cmake.in | 13 | ||||
-rw-r--r-- | libtiff/tiffconf.h.in | 13 |
4 files changed, 28 insertions, 6 deletions
diff --git a/libtiff/tif_lerc.c b/libtiff/tif_lerc.c index 99de713c..4f357a60 100644 --- a/libtiff/tif_lerc.c +++ b/libtiff/tif_lerc.c @@ -517,7 +517,7 @@ static int LERCPreDecode(TIFF *tif, uint16_t s) { const unsigned nb_pixels = sp->segment_width * sp->segment_height; unsigned i; -#if HOST_BIGENDIAN +#if WORDS_BIGENDIAN const unsigned char nan_bytes[] = {0x7f, 0xc0, 0, 0}; #else const unsigned char nan_bytes[] = {0, 0, 0xc0, 0x7f}; diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c index aa16a64f..23fcf81c 100644 --- a/libtiff/tif_open.c +++ b/libtiff/tif_open.c @@ -365,8 +365,12 @@ TIFF *TIFFClientOpenExt(const char *name, const char *mode, (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_LSB2MSB; break; case 'H': + TIFFWarningExtR(tif, name, + "H(ost) mode is deprecated. Since " + "libtiff 4.5.1, it is an alias of 'B' / " + "FILLORDER_MSB2LSB."); tif->tif_flags = - (tif->tif_flags & ~TIFF_FILLORDER) | HOST_FILLORDER; + (tif->tif_flags & ~TIFF_FILLORDER) | FILLORDER_MSB2LSB; break; case 'M': if (m == O_RDONLY) diff --git a/libtiff/tiffconf.h.cmake.in b/libtiff/tiffconf.h.cmake.in index e3a830d4..306874f5 100644 --- a/libtiff/tiffconf.h.cmake.in +++ b/libtiff/tiffconf.h.cmake.in @@ -52,8 +52,17 @@ machine */ #cmakedefine HAVE_IEEEFP 1 -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER @HOST_FILLORDER@ +/* The concept of HOST_FILLORDER is broken. Since libtiff 4.5.1 + * this macro will always be hardcoded to FILLORDER_LSB2MSB on all + * architectures, to reflect past long behavior of doing so on x86 architecture. + * Note however that the default FillOrder used by libtiff is FILLORDER_MSB2LSB, + * as mandated per the TIFF specification. + * The influence of HOST_FILLORDER is only when passing the 'H' mode in + * TIFFOpen(). + * You should NOT rely on this macro to decide the CPU endianness! + * This macro will be removed in libtiff 4.6 + */ +#define HOST_FILLORDER FILLORDER_LSB2MSB /* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel) */ diff --git a/libtiff/tiffconf.h.in b/libtiff/tiffconf.h.in index 2a8b03e9..ab017357 100644 --- a/libtiff/tiffconf.h.in +++ b/libtiff/tiffconf.h.in @@ -52,8 +52,17 @@ machine */ #undef HAVE_IEEEFP -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#undef HOST_FILLORDER +/* The concept of HOST_FILLORDER is broken. Since libtiff 4.5.1 + * this macro will always be hardcoded to FILLORDER_LSB2MSB on all + * architectures, to reflect past long behavior of doing so on x86 architecture. + * Note however that the default FillOrder used by libtiff is FILLORDER_MSB2LSB, + * as mandated per the TIFF specification. + * The influence of HOST_FILLORDER is only when passing the 'H' mode in + * TIFFOpen(). + * You should NOT rely on this macro to decide the CPU endianness! + * This macro will be removed in libtiff 4.6 + */ +#define HOST_FILLORDER FILLORDER_LSB2MSB /* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel) */ |