wkz / mdio-tools

Low-level debug tools for MDIO devices.
GNU General Public License v2.0
66 stars 31 forks source link

sys/queue.h is used even when unavailable #19

Closed neheb closed 2 years ago

neheb commented 2 years ago

musl libc does not come with sys/queue.h by default, breaking compilation.

Potential fallback is libbsd, preferably the overlay mode.

troglobit commented 2 years ago

I suggest importing the latest queue.h from OpenBSD and using that instead, it carries the _SAFE macros as well which are preferable when traversing lists while deleting nodes. No need to add another external dependency (libbsd) to this project for this.

robimarko commented 2 years ago

@neheb On what host is this breaking?

Works fine for me

neheb commented 2 years ago

OpenWrt with the sys/queue.h header removed. The goal is to reduce OpenWrt's diff compared to upstream. Removing sys/queue.h seems to be too hard as projects seem unwilling to use libbsd.

robimarko commented 2 years ago

That is gonna be hard as nobody wants additional dependency