The __APPLE__ macro is defined on all Apple platforms, but only the macOS SDK ships <net/route.h>. Use __has_include(<net/route.h>) to compile the route-table code only where its header exists, the same idiom randomenv.cpp and util/threadnames.cpp use for system headers, so unsupported platforms use the existing dummy implementation (return std::nullopt).
No behavior change on any currently built platform; no CI changes are requested.
This PR does not add support for iOS or any other Apple platform. SDKs without <net/route.h> remain unsupported; they now reach the file's existing dummy implementation instead of failing on an include their SDK does not ship.
Reproduction (any Mac with Xcode installed)
unsupported platform
echo '#include <net/route.h>' | xcrun --sdk iphoneos clang -x c++ -fsyntax-only -
# <stdin>:1:10: fatal error: 'net/route.h' file not found
macOS
echo '#include <net/route.h>' | xcrun --sdk macosx clang -x c++ -fsyntax-only -
# no output == success
What I tested
# fresh configure, Xcode 26.6, Boost 1.90; builds cleanly
cmake --build build -j
# 100% tests passed out of 351
ctest --test-dir build -j