net + posix: avoid host includes when building for native_sim
A corner case involving C++, posix, networking, and native_sim was causing problems. Even though C and C++ builds should include zephyr/posix/.. in the default search path with `CONFIG_POSIX_API=y`, for some reason, the native compiler pulls in /usr/include first anyway. The stat.h header pulled in <sys/types.h> (which is normally fine) but due to the native build, it was pulling in /usr/include/sys/types.h, from the host toolchain. Explicitly include <zephyr/posix/posix_types.h> instead of <sys/types.h> from stat.h, and continue using the workarounds for native builds (explicitly including zephyr/posix/arpa/net.h from net/sockets.h . Signed-off-by:Chris Friedt <cfriedt@tenstorrent.com> (cherry picked from commit 81f52050)
Loading
Please sign in to comment