Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for C99 math functions, hypot, atanh, cbrt, etc. #555

Merged
merged 2 commits into from
Aug 13, 2017

Conversation

cffk
Copy link
Contributor

@cffk cffk commented Aug 6, 2017

This tests whether the functions are declared in <math.h>. If they are,
then -DHAVE_C99_MATH=1 is added to the C flags. The intention is that
this flag is only seen when building proj.4 and shouldn't be referenced
in any of the installed include files. The next update to geodesic.c
will use this flag.

Left unaddressed is what to do if HAVE_C99_MATH is 0. The strategy in
geodesic.c is to assume that the missing functions will need to be
defined explicitly. A less safe alternative is to assume that the
functions are in fact available in libm and that all that needs to be
done is to declare the functions.

This tests whether the functions are declared in <math.h>.  If they are,
then -DHAVE_C99_MATH=1 is added to the C flags.  The intention is that
this flag is only seen when building proj.4 and shouldn't be referenced
in any of the installed include files.  The next update to geodesic.c
will use this flag.

Left unaddressed is what to do if HAVE_C99_MATH is 0.  The strategy in
geodesic.c is to assume that the missing functions will need to be
defined explicitly.  A less safe alternative is to assume that the
functions are in fact available in libm and that all that needs to be
done is to declare the functions.
@cffk
Copy link
Contributor Author

cffk commented Aug 6, 2017

I suppose an additional test could be made where math.h is missing these functions to see if libm has them defined nevertheless. Probably it would be best to formulate a general strategy first. Presumably at some point we can declare that proj.4 requires a C99 (or later) compliant compiler.

@cffk cffk merged commit c489464 into OSGeo:master Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant