Re: compile detection of powf, etc



On 2006-01-30, Marco <prenom_nomus@xxxxxxxxx> wrote:
> Is there a standard way using the preprocessor to detect if a given C
> compiler/library environment provides the C99 <math.h> floating point
> functions such as:
>
> float powf(float x, float y);
> float sqrtf(float x);
> etc
>
> so we could "provide" these prototypes or not via our
>
> "xtra_math.h" file
>
> Note some C environments are incomplete and may define the C90 flag but
> still provide these functions. So I think we need to check each
> function.
>
> looking for any suggestions
>
> thanks

(semi-offtopic)
One way [this is highly system-specific - basically unix-only, and may
not be guaranteed even by the POSIX standard] would be to provide the
functions in a static library and link it after libm. If the link editor
finds it in libm, it won't take the one from your library.
static library
.