interp: fix build error on Ubuntu 16.04
"halbritt" reports that taskintf.cc has a problem building on Ubuntu 16.04,
possibly due to a glibc or libstdc++ standards-conformance bug.
https://sourceware.org/bugzilla/show_bug.cgi?id=19439#c12
He tested and says that this change I proposed fixes it.
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
This commit is contained in:
parent
0818599209
commit
9d6a5bc06a
1 changed files with 36 additions and 36 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <math.h> // isnan()
|
#include <cmath>
|
||||||
#include <float.h> // DBL_MAX
|
#include <float.h> // DBL_MAX
|
||||||
#include <string.h> // memcpy() strncpy()
|
#include <string.h> // memcpy() strncpy()
|
||||||
#include <unistd.h> // unlink()
|
#include <unistd.h> // unlink()
|
||||||
|
|
@ -110,8 +110,8 @@ int emcAxisSetUnits(int axis, double units)
|
||||||
int emcAxisSetBacklash(int axis, double backlash)
|
int emcAxisSetBacklash(int axis, double backlash)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(backlash)) {
|
if (std::isnan(backlash)) {
|
||||||
printf("isnan error in emcAxisSetBacklash()\n");
|
printf("std::isnan error in emcAxisSetBacklash()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -135,8 +135,8 @@ static double saveMaxLimit[EMCMOT_MAX_JOINTS];
|
||||||
int emcAxisSetMinPositionLimit(int axis, double limit)
|
int emcAxisSetMinPositionLimit(int axis, double limit)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(limit)) {
|
if (std::isnan(limit)) {
|
||||||
printf("isnan error in emcAxisSetMinPosition()\n");
|
printf("std::isnan error in emcAxisSetMinPosition()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -157,8 +157,8 @@ int emcAxisSetMinPositionLimit(int axis, double limit)
|
||||||
int emcAxisSetMaxPositionLimit(int axis, double limit)
|
int emcAxisSetMaxPositionLimit(int axis, double limit)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(limit)) {
|
if (std::isnan(limit)) {
|
||||||
printf("isnan error in emcAxisSetMaxPosition()\n");
|
printf("std::isnan error in emcAxisSetMaxPosition()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -179,8 +179,8 @@ int emcAxisSetMaxPositionLimit(int axis, double limit)
|
||||||
int emcAxisSetMotorOffset(int axis, double offset)
|
int emcAxisSetMotorOffset(int axis, double offset)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(offset)) {
|
if (std::isnan(offset)) {
|
||||||
printf("isnan error in emcAxisSetMotorOffset()\n");
|
printf("std::isnan error in emcAxisSetMotorOffset()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -198,8 +198,8 @@ int emcAxisSetMotorOffset(int axis, double offset)
|
||||||
int emcAxisSetFerror(int axis, double ferror)
|
int emcAxisSetFerror(int axis, double ferror)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(ferror)) {
|
if (std::isnan(ferror)) {
|
||||||
printf("isnan error in emcAxisSetFerror()\n");
|
printf("std::isnan error in emcAxisSetFerror()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -218,8 +218,8 @@ int emcAxisSetFerror(int axis, double ferror)
|
||||||
int emcAxisSetMinFerror(int axis, double ferror)
|
int emcAxisSetMinFerror(int axis, double ferror)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(ferror)) {
|
if (std::isnan(ferror)) {
|
||||||
printf("isnan error in emcAxisSetMinFerror()\n");
|
printf("std::isnan error in emcAxisSetMinFerror()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -240,9 +240,9 @@ int emcAxisSetHomingParams(int axis, double home, double offset, double home_fin
|
||||||
int sequence,int volatile_home, int locking_indexer)
|
int sequence,int volatile_home, int locking_indexer)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(home) || isnan(offset) || isnan(home_final_vel) ||
|
if (std::isnan(home) || std::isnan(offset) || std::isnan(home_final_vel) ||
|
||||||
isnan(search_vel) || isnan(latch_vel)) {
|
std::isnan(search_vel) || std::isnan(latch_vel)) {
|
||||||
printf("isnan error in emcAxisSetHoming()\n");
|
printf("std::isnan error in emcAxisSetHoming()\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -772,10 +772,10 @@ int emcTrajSetMaxAcceleration(double acc)
|
||||||
int emcTrajSetHome(EmcPose home)
|
int emcTrajSetHome(EmcPose home)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(home.tran.x) || isnan(home.tran.y) || isnan(home.tran.z) ||
|
if (std::isnan(home.tran.x) || std::isnan(home.tran.y) || std::isnan(home.tran.z) ||
|
||||||
isnan(home.a) || isnan(home.b) || isnan(home.c) ||
|
std::isnan(home.a) || std::isnan(home.b) || std::isnan(home.c) ||
|
||||||
isnan(home.u) || isnan(home.v) || isnan(home.w)) {
|
std::isnan(home.u) || std::isnan(home.v) || std::isnan(home.w)) {
|
||||||
printf("isnan error in emcTrajSetHome()\n");
|
printf("std::isnan error in emcTrajSetHome()\n");
|
||||||
return 0; // ignore it for now, just don't send it
|
return 0; // ignore it for now, just don't send it
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -990,10 +990,10 @@ int emcTrajLinearMove(EmcPose end, int type, double vel, double ini_maxvel, doub
|
||||||
int indexrotary)
|
int indexrotary)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(end.tran.x) || isnan(end.tran.y) || isnan(end.tran.z) ||
|
if (std::isnan(end.tran.x) || std::isnan(end.tran.y) || std::isnan(end.tran.z) ||
|
||||||
isnan(end.a) || isnan(end.b) || isnan(end.c) ||
|
std::isnan(end.a) || std::isnan(end.b) || std::isnan(end.c) ||
|
||||||
isnan(end.u) || isnan(end.v) || isnan(end.w)) {
|
std::isnan(end.u) || std::isnan(end.v) || std::isnan(end.w)) {
|
||||||
printf("isnan error in emcTrajLinearMove()\n");
|
printf("std::isnan error in emcTrajLinearMove()\n");
|
||||||
return 0; // ignore it for now, just don't send it
|
return 0; // ignore it for now, just don't send it
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1016,12 +1016,12 @@ int emcTrajCircularMove(EmcPose end, PM_CARTESIAN center,
|
||||||
PM_CARTESIAN normal, int turn, int type, double vel, double ini_maxvel, double acc)
|
PM_CARTESIAN normal, int turn, int type, double vel, double ini_maxvel, double acc)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(end.tran.x) || isnan(end.tran.y) || isnan(end.tran.z) ||
|
if (std::isnan(end.tran.x) || std::isnan(end.tran.y) || std::isnan(end.tran.z) ||
|
||||||
isnan(end.a) || isnan(end.b) || isnan(end.c) ||
|
std::isnan(end.a) || std::isnan(end.b) || std::isnan(end.c) ||
|
||||||
isnan(end.u) || isnan(end.v) || isnan(end.w) ||
|
std::isnan(end.u) || std::isnan(end.v) || std::isnan(end.w) ||
|
||||||
isnan(center.x) || isnan(center.y) || isnan(center.z) ||
|
std::isnan(center.x) || std::isnan(center.y) || std::isnan(center.z) ||
|
||||||
isnan(normal.x) || isnan(normal.y) || isnan(normal.z)) {
|
std::isnan(normal.x) || std::isnan(normal.y) || std::isnan(normal.z)) {
|
||||||
printf("isnan error in emcTrajCircularMove()\n");
|
printf("std::isnan error in emcTrajCircularMove()\n");
|
||||||
return 0; // ignore it for now, just don't send it
|
return 0; // ignore it for now, just don't send it
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1059,10 +1059,10 @@ int emcTrajClearProbeTrippedFlag()
|
||||||
int emcTrajProbe(EmcPose pos, int type, double vel, double ini_maxvel, double acc, unsigned char probe_type)
|
int emcTrajProbe(EmcPose pos, int type, double vel, double ini_maxvel, double acc, unsigned char probe_type)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(pos.tran.x) || isnan(pos.tran.y) || isnan(pos.tran.z) ||
|
if (std::isnan(pos.tran.x) || std::isnan(pos.tran.y) || std::isnan(pos.tran.z) ||
|
||||||
isnan(pos.a) || isnan(pos.b) || isnan(pos.c) ||
|
std::isnan(pos.a) || std::isnan(pos.b) || std::isnan(pos.c) ||
|
||||||
isnan(pos.u) || isnan(pos.v) || isnan(pos.w)) {
|
std::isnan(pos.u) || std::isnan(pos.v) || std::isnan(pos.w)) {
|
||||||
printf("isnan error in emcTrajProbe()\n");
|
printf("std::isnan error in emcTrajProbe()\n");
|
||||||
return 0; // ignore it for now, just don't send it
|
return 0; // ignore it for now, just don't send it
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1082,8 +1082,8 @@ int emcTrajProbe(EmcPose pos, int type, double vel, double ini_maxvel, double ac
|
||||||
int emcTrajRigidTap(EmcPose pos, double vel, double ini_maxvel, double acc)
|
int emcTrajRigidTap(EmcPose pos, double vel, double ini_maxvel, double acc)
|
||||||
{
|
{
|
||||||
#ifdef ISNAN_TRAP
|
#ifdef ISNAN_TRAP
|
||||||
if (isnan(pos.tran.x) || isnan(pos.tran.y) || isnan(pos.tran.z)) {
|
if (std::isnan(pos.tran.x) || std::isnan(pos.tran.y) || std::isnan(pos.tran.z)) {
|
||||||
printf("isnan error in emcTrajRigidTap()\n");
|
printf("std::isnan error in emcTrajRigidTap()\n");
|
||||||
return 0; // ignore it for now, just don't send it
|
return 0; // ignore it for now, just don't send it
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue