WebPlatformForEmbedded / libwpe

General-purpose library specifically developed for the WPE-flavored port of WebKit.
BSD 2-Clause "Simplified" License
49 stars 36 forks source link

Fix build failure due to libc functions used in old glibc and libc++ headers #122

Closed blino closed 2 years ago

blino commented 2 years ago

glibc < 2.26 uses calloc and malloc for the str(n)dup macros in bits/string2.h, included by string.h

libc++ cstdlib header can also use ::malloc, ::realloc, ::calloc and ::free

Fixes: 159851d069fe ("Wrap memory allocation functions to abort on failure") Fixes: d77bc02f6b00 ("Fix build failure due to libc++ using libc functions")

This could be backported to 1.12 and 1.14 branches.

aperezdc commented 2 years ago

Cherry-picked as commit cb8642f2755d58b036677420a6484f33ffb440df in the libwpe-1.14 branch, and as commit b955d2dd90817750fca95c5812c192e8373d497a in the libwpe-1.12 branch.

Thanks for the fix, @blino!