commit 3a937a09c54b33deccd487a90057e410c0c0bd87
parent ee373fb7f90536d5261cc06dd016a7f8d5058138
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sat, 6 May 2023 16:39:17 +0200
Fix the C89 compilation of some tests
Two tests assumed they were built to the C99 standard when in fact only
the star-3d library needs to be built in C99 (because of Embree). Its
API remains purely C89. In this commit we update the offending tests to
be C89 compliant by explicitly enabling the POSIX 2001 standard required
by the expf, nextafterf, and fabsf functions they use.
Diffstat:
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/test_s3d_closest_point.c b/src/test_s3d_closest_point.c
@@ -30,6 +30,8 @@
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. */
+#define _POSIX_C_SOURCE 200112L /* exp2f, fabsf, nextafterf */
+
#include "s3d.h"
#include "test_s3d_cbox.h"
#include "test_s3d_utils.h"
diff --git a/src/test_s3d_trace_ray.c b/src/test_s3d_trace_ray.c
@@ -30,6 +30,8 @@
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. */
+#define _POSIX_C_SOURCE 200112L /* exp2f, fabsf */
+
#include "s3d.h"
#include "test_s3d_camera.h"
#include "test_s3d_cbox.h"