fix osx abs ambiguity (#142)
This commit is contained in:
committed by
Jason Watkins
parent
cf6a45fb87
commit
7fd4d4d6b2
@@ -67,6 +67,7 @@
|
|||||||
// System Includes
|
// System Includes
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cmath>
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <mach/mach_time.h>
|
#include <mach/mach_time.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -95,8 +96,7 @@ PLUGIN_API int XPluginStart(char* outName, char* outSig, char* outDesc)
|
|||||||
strcpy(outDesc, "X Plane Communications Toolbox\nCopyright (c) 2013-2018 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.");
|
strcpy(outDesc, "X Plane Communications Toolbox\nCopyright (c) 2013-2018 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.");
|
||||||
|
|
||||||
#if (__APPLE__)
|
#if (__APPLE__)
|
||||||
int (*_abs)( int ) = & std::abs; // Needed to resolve ambiguity for OS X compilation
|
if ( abs(timeConvert) <= 1e-9 ) // is about 0
|
||||||
if ( _abs(timeConvert) <= 1e-9 ) // is about 0
|
|
||||||
{
|
{
|
||||||
mach_timebase_info_data_t timeBase;
|
mach_timebase_info_data_t timeBase;
|
||||||
(void)mach_timebase_info(&timeBase);
|
(void)mach_timebase_info(&timeBase);
|
||||||
|
|||||||
Reference in New Issue
Block a user