summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2024-03-02 18:09:26 -0500
committerEven Rouault <even.rouault@spatialys.com>2024-03-04 22:12:38 +0100
commit995d8c96b51f3e510457cf71b5b5902de11dc08c (patch)
tree643da52ff655a3184af5dc3d245d27a22af19d03 /src/bin
parentc28f012daeb9b67215f8f21e7cfa6541b5c9cca3 (diff)
Fix building on OpenBSD big endian hosts
There is a swap16() function which conflicts with such a macro in the endian.h header. uint16_t swap16(uint16_t val16); Do as suggested and rename the function to opj_swap16().
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/jp2/convert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c
index 7205ccf9..234302fe 100644
--- a/src/bin/jp2/convert.c
+++ b/src/bin/jp2/convert.c
@@ -664,7 +664,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,
#ifdef OPJ_BIG_ENDIAN
-static INLINE OPJ_UINT16 swap16(OPJ_UINT16 x)
+static INLINE OPJ_UINT16 opj_swap16(OPJ_UINT16 x)
{
return (OPJ_UINT16)(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
}
@@ -733,8 +733,8 @@ static int tga_writeheader(FILE *fp, int bits_per_pixel, int width, int height,
goto fails;
}
#else
- image_w = swap16(image_w);
- image_h = swap16(image_h);
+ image_w = opj_swap16(image_w);
+ image_h = opj_swap16(image_h);
if (fwrite(&image_w, 2, 1, fp) != 1) {
goto fails;
}