diff options
| -rw-r--r-- | src/dxfdata.cc | 2 | ||||
| -rw-r--r-- | src/dxfdim.cc | 2 | ||||
| -rw-r--r-- | src/dxftess-glu.cc | 2 | ||||
| -rw-r--r-- | src/func.cc | 2 | ||||
| -rw-r--r-- | src/glview.cc | 2 | ||||
| -rw-r--r-- | src/grid.h | 2 | ||||
| -rw-r--r-- | src/mathc99.cc | 5 | ||||
| -rw-r--r-- | src/mathc99.h | 16 | ||||
| -rw-r--r-- | src/value.cc | 2 | 
9 files changed, 28 insertions, 7 deletions
| diff --git a/src/dxfdata.cc b/src/dxfdata.cc index dc3e8a1..0579389 100644 --- a/src/dxfdata.cc +++ b/src/dxfdata.cc @@ -32,7 +32,7 @@  #include <QTextStream>  #include <QHash>  #include <QVector> -#include <math.h> +#include "mathc99.h"  #include <assert.h>  struct Line { diff --git a/src/dxfdim.cc b/src/dxfdim.cc index 02a1274..a45768d 100644 --- a/src/dxfdim.cc +++ b/src/dxfdim.cc @@ -31,7 +31,7 @@  #include "printutils.h"  #include "context.h" -#include <math.h> +#include "mathc99.h"  #include <sys/types.h>  #include <sys/stat.h>  #include <unistd.h> diff --git a/src/dxftess-glu.cc b/src/dxftess-glu.cc index ca12ea9..63fa2e5 100644 --- a/src/dxftess-glu.cc +++ b/src/dxftess-glu.cc @@ -9,7 +9,7 @@  #  include <GL/glew.h>  #endif  #include <qgl.h> -#include <math.h> +#include "mathc99.h"  #ifdef WIN32  #  define STDCALL __stdcall diff --git a/src/func.cc b/src/func.cc index e8ff54a..46b29a8 100644 --- a/src/func.cc +++ b/src/func.cc @@ -28,7 +28,7 @@  #include "context.h"  #include "dxfdim.h"  #include "builtin.h" -#include <math.h> +#include "mathc99.h"  AbstractFunction::~AbstractFunction()  { diff --git a/src/glview.cc b/src/glview.cc index d51714b..0b161c8 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -31,7 +31,7 @@  #include <QMouseEvent>  #include <QMessageBox>  #include <QTimer> -#include <math.h> +#include "mathc99.h"  #include <stdio.h>  #define FAR_FAR_AWAY 100000.0 @@ -1,7 +1,7 @@  #ifndef GRID_H_  #define GRID_H_ -#include <math.h> +#include "mathc99.h"  #include <stdint.h>  #include <stdlib.h>  #include <QHash> diff --git a/src/mathc99.cc b/src/mathc99.cc new file mode 100644 index 0000000..db71059 --- /dev/null +++ b/src/mathc99.cc @@ -0,0 +1,5 @@ +#include "mathc99.h"
 +
 +double found(double a) {
 +    return a > 0 ? floor(a+0.5) : ceil(a-0.5);
 +}
 diff --git a/src/mathc99.h b/src/mathc99.h new file mode 100644 index 0000000..4d5d3be --- /dev/null +++ b/src/mathc99.h @@ -0,0 +1,16 @@ +#ifndef MATHC99_H_
 +#define MATHC99_H_
 +
 +#ifdef WIN32
 +
 +#include <cmath>
 +//for native win32 builds we need to provide C99 math functions by ourselves
 +double round(double a);
 +
 +#else
 +
 +#include <math.h>
 +
 +#endif
 +
 +#endif
 diff --git a/src/value.cc b/src/value.cc index a237c5a..3931755 100644 --- a/src/value.cc +++ b/src/value.cc @@ -24,7 +24,7 @@   */  #include "value.h" -#include <math.h> +#include "mathc99.h"  Value::Value()  { | 
