OSDN Git Service

util: Use meson checks for valloc() and memalign() presence
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 26 Feb 2022 18:07:21 +0000 (18:07 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 7 Mar 2022 13:16:05 +0000 (13:16 +0000)
commit88454f844efe26ea8ac7f394a72b1e6620dccf7e
treea4cb9fee7fe522abba9ffd71a427f14dbcecb7e6
parent5c8c714a0a78dfd0bb7b04e796b96eb5d41f1292
util: Use meson checks for valloc() and memalign() presence

Instead of assuming that all CONFIG_BSD have valloc() and anything
else is memalign(), explicitly check for those functions in
meson.build and use the "is the function present" define.  Tests for
specific functionality are better than which-OS checks; this also
lets us give a helpful error message if somehow there's no usable
function present.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220226180723.1706285-8-peter.maydell@linaro.org
meson.build
util/memalign.c