Skip to content

Commit f936b68

Browse files
committed
Fix includes for M_PI on Windows
Signed-off-by: PhRosenberger <philipp.rosenberger@tu-darmstadt.de>
1 parent 22f2337 commit f936b68

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

examples/OSMPDummySensor_flat/OSMPDummySensor.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
1111
*/
1212

13+
#ifndef _USE_MATH_DEFINES
14+
#define _USE_MATH_DEFINES
15+
#endif
16+
1317
#include "OSMPDummySensor.h"
1418

1519
/*
@@ -49,9 +53,14 @@
4953
#include <string>
5054
#include <algorithm>
5155
#include <cstdint>
52-
#include <cmath>
5356
#include <chrono>
5457

58+
#ifdef _WIN32
59+
#include <math.h>
60+
#else
61+
#include <cmath>
62+
#endif
63+
5564
using namespace std;
5665

5766
#ifdef PRIVATE_LOG_PATH

examples/OSMPDummySource_flat/OSMPDummySource.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
1111
*/
1212

13+
#ifndef _USE_MATH_DEFINES
14+
#define _USE_MATH_DEFINES
15+
#endif
16+
1317
#include "OSMPDummySource.h"
1418

1519
/*
@@ -49,12 +53,17 @@
4953
//#include <string>
5054
#include <algorithm>
5155
#include <cstdint>
52-
#include <cmath>
5356
#include <chrono>
5457
#include <ctime>
5558
#include <iomanip>
5659
#include <sstream> //included for windows compatibility
5760

61+
#ifdef _WIN32
62+
#include <math.h>
63+
#else
64+
#include <cmath>
65+
#endif
66+
5867
using namespace std;
5968

6069
#ifdef PRIVATE_LOG_PATH

0 commit comments

Comments
 (0)