gpiosim: use twalk() instead of twalk_r()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 10 Feb 2023 21:11:11 +0000 (22:11 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 14 Feb 2023 08:13:59 +0000 (09:13 +0100)
commit5e111df2fca56d57193a1825e45e78dd8b76c0f1
tree45087afb274870f5e06ff45aa2cfe5fd6abc0b32
parent8b99eb43f210194fe7f34b6d9a57b287b26fb771
gpiosim: use twalk() instead of twalk_r()

twalk_r() is a GNU extension for the binary search tree API. Musl libc
doesn't provide it and after inquiring with the maintainer it turned out
it won't provide it anytime soon as musl strives to only implement well
standardized functions.

In order to not limit building libgpiosim and tests to glibc only, let's
replace twalk_r() with twalk() and use global variables for the state.
It's not a big deal as we're already using a global root node and a mutex
to protect it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
configure.ac
tests/gpiosim/gpiosim.c