misc: Address issues uncovered with GCC 16 + binutils 2.46 (1/N)

* Funky macro-based definitions for memchr and strstr
   which require an #undef before we use our own in codecs & plugins
 * Return value of of strstr is const

Still have several more warnings and link failure with some plugins
but this is a good start.

Change-Id: Ife1f2d3e6f0e0629e3125a9058abc39c6102f452
This commit is contained in:
Solomon Peachy 2026-05-01 22:42:58 -04:00
parent 8e8206f6d5
commit f886bfc572
8 changed files with 19 additions and 11 deletions

View file

@ -38,7 +38,7 @@ int codec_init(void)
/* codec_get_buffer() aligns the resulting point to MEM_ALIGN_SIZE. */
mem_ptr = 0;
mallocbuf = (unsigned char *)ci->codec_get_buffer((size_t *)&bufsize);
return 0;
}
@ -64,9 +64,9 @@ void* codec_malloc(size_t size)
if (mem_ptr + (long)size > bufsize)
return NULL;
x=&mallocbuf[mem_ptr];
/* Keep memory aligned to MEM_ALIGN_SIZE. */
mem_ptr += MEM_ALIGN_UP(size);
@ -136,6 +136,7 @@ int memcmp(const void *s1, const void *s2, size_t n)
return(ci->memcmp(s1,s2,n));
}
#undef memchr
void* memchr(const void *s, int c, size_t n)
{
return(ci->memchr(s,c,n));