Commit 96fd7a03 authored by Don Gagne's avatar Don Gagne

Fix macro redefinition errors

This removes a race condition between both qwt and qt against math.h on
windows with _USE_MATH_DEFINES set. If math.h comes after qwt or qt
math headers the math defines will be redefined. Really nasty to track
down and ordering problems. So instead I just removed using math
defines on windows and fall back to asin definition of M_PI_2. This
will have some slight perf impact since it calls function instead of
using constant. But I doubt on any of today’s machine it really makes a
difference.
parent aa14800f
#ifndef _MAVLINK_CONVERSIONS_H_
#define _MAVLINK_CONVERSIONS_H_
/* enable math defines on Windows */
#ifdef _MSC_VER
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#endif
#include <math.h>
#ifndef M_PI_2
#define M_PI_2 ((float)asin(1))
#define M_PI_2 ((float)asin(1.0f))
#endif
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment