Skip to content

Commit c485db5

Browse files
committed
Some fixes to be able to build the system versions of the tests.
1 parent f418d26 commit c485db5

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/libm-test.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@
117117

118118
#include "libm-test-ulps.h"
119119
#include <float.h>
120+
#ifdef SYS_MATH_H
121+
#include <math.h>
122+
#include <fenv.h>
123+
#else
120124
#include <openlibm.h>
121125
#include <openlibm_complex.h>
122126
#include <openlibm_fenv.h>
127+
#endif
123128

124129
#if 0 /* XXX scp XXX */
125130
#define FE_INEXACT FE_INEXACT
@@ -142,6 +147,16 @@
142147
// Some native libm implementations don't have sincos defined, so we have to do it ourselves
143148
void FUNC(sincos) (FLOAT x, FLOAT * s, FLOAT * c);
144149

150+
#ifdef __APPLE__
151+
#ifdef SYS_MATH_H
152+
void sincos(FLOAT x, FLOAT * s, FLOAT * c)
153+
{
154+
*s = sin(x);
155+
*c = cos(x);
156+
}
157+
#endif
158+
#endif
159+
145160
/* Possible exceptions */
146161
#define NO_EXCEPTION 0x0
147162
#define INVALID_EXCEPTION 0x1

0 commit comments

Comments
 (0)