Skip to content

Commit b4d6bb2

Browse files
committed
Make compatible with Alpine linux by using cmath instead of math.h
1 parent ae8e23d commit b4d6bb2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/platformcompat.hh

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef __PLATFORMCOMPAT_H
22
#define __PLATFORMCOMPAT_H
33

4-
#include <math.h> // round()
5-
64
#if defined(_MSC_VER)
75
#include <float.h> //isinf, isnan
86
#include <stdlib.h> //min
@@ -11,10 +9,11 @@
119
#define FMIN __min
1210
#define ROUND(x) floor(x + 0.5)
1311
#else
14-
#define ISINF isinf
15-
#define ISNAN isnan
12+
#include <cmath> // round(), isinf, isnan
13+
#define ISINF std::isinf
14+
#define ISNAN std::isnan
1615
#define FMIN fmin
1716
#define ROUND round
1817
#endif
1918

20-
#endif
19+
#endif

0 commit comments

Comments
 (0)