From 7fecc7d15379eb81b2542857d823777a81b5764a Mon Sep 17 00:00:00 2001 From: lotherk Date: Mon, 23 Nov 2026 12:51:39 +0000 Subject: [PATCH] curses: le16enc/le32enc only where the libc has none NetBSD's defines le16dec, le32dec, le16enc and le32enc, and the vendored replacement redefined them -- "redefinition of 'le16enc'", which stopped the cross build at tic/tic.o (build/logs/release-2026-11-23i-cross.log:94). Test: x86_64--netbsd-gcc -std=gnu11 -I. -I./libterminfo -I build/obj/destdir.amd64/usr/include -c tic/tic.c -> rc=0. --- vendor/netbsd-curses/netbsd_sys/endian.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vendor/netbsd-curses/netbsd_sys/endian.h b/vendor/netbsd-curses/netbsd_sys/endian.h index 012869d..1c312aa 100644 --- a/vendor/netbsd-curses/netbsd_sys/endian.h +++ b/vendor/netbsd-curses/netbsd_sys/endian.h @@ -33,6 +33,12 @@ static __inline uint16_t nbs_bswap16(uint16_t __x) #endif #define __CAST(__dt, __st) ((__dt)(__st)) +/* NetBSD's own already defines le16dec, le32dec, le16enc and + * le32enc (as inline functions since 1998), so this replacement contradicts it + * -- "redefinition of 'le16enc'", which stopped the cross build + * (build/logs/release-2026-11-23i-cross.log:94). Only a libc without them + * needs the block; the guard asks the header that provides them. */ +#ifndef __NetBSD__ static inline uint16_t le16dec(const void *buf) { @@ -66,6 +72,7 @@ le32enc(void *buf, uint32_t u) p[2] = __CAST(uint8_t, ((u >> 16) & 0xff)); p[3] = __CAST(uint8_t, ((u >> 24) & 0xff)); } +#endif /* !__NetBSD__ */ #endif