D
David Mathog
Is there a standard, or at least common, method for testing for the
existence of a function in a particular compiler implementation that
does not depend upon the definition of an associated preprocessor
variable? For instance chown() is often not implemented on some
platforms, so what I'm looking for is an expression like:
#if MAGIC_HERE(chown)
/* use chown() somehow */
#else
/* do nothing */
#endif
I already looked in the FAQ and didn't see anything, but given the size
of that document, I could have missed it.
Assuming there is no such method, would it not be convenient to
implement it? I understand that when generating object files the
compiler will not necessarily know whether or not a particular function
being called exists, that won't be determined until the link phase.
However, it seems resonable that the compiler should, or at least could,
have a list available of all the functions in its own libraries, making
such a test possible.
Thanks,
David Mathog
existence of a function in a particular compiler implementation that
does not depend upon the definition of an associated preprocessor
variable? For instance chown() is often not implemented on some
platforms, so what I'm looking for is an expression like:
#if MAGIC_HERE(chown)
/* use chown() somehow */
#else
/* do nothing */
#endif
I already looked in the FAQ and didn't see anything, but given the size
of that document, I could have missed it.
Assuming there is no such method, would it not be convenient to
implement it? I understand that when generating object files the
compiler will not necessarily know whether or not a particular function
being called exists, that won't be determined until the link phase.
However, it seems resonable that the compiler should, or at least could,
have a list available of all the functions in its own libraries, making
such a test possible.
Thanks,
David Mathog