Hacker News new | ask | show | jobs
by nektro 1 day ago
> supposed to be dynamically probed to adapt to different toolchain environments

that's a bygone practice from before compilers were widely capable.

1 comments

You still can't test for the existence of functions, non-macro constants, typedefs, structure members, or other arbitrary interfaces. Newer compiler introspection facilities like __has_include or __has_builtin generally only help with compiler portability.

musl libc specifically recommends using external feature detection a la autoconf, and is so opinionated about this that it refuses to add any identifying macros, like __GLIBC__.