LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.73k stars 1.13k forks source link

Posemath #define toLine() is same defined as in Qt library. #2986

Open krcwrhvgyxzqelljes opened 1 month ago

krcwrhvgyxzqelljes commented 1 month ago

Hi,

~/linuxcnc/src/libnml/posemath/posemath.h Line 978

The problem is that same name is used in qt libraries.

define toLine(src,dst) {toPose((src).start, &((dst)->start)); toPose((src).end, &((dst)->end)); toCart((src).uVec, &((dst)->uVec));}

Can you rename this to :

define toLine_(src,dst) {toPose((src).start, &((dst)->start)); toPose((src).end, &((dst)->end)); toCart((src).uVec, &((dst)->uVec));}

Then it compiles along with qt libraries and problem is solved.

~/qt-creator/5.15.1/gcc_64/include/QtCore/qvariant.h line 324 : QLine toLine() const;

Compile ouput: error: expected ';' at end of declaration list QLine toLine() const;

rmu75 commented 1 week ago

These toLine etc... macros shouldn't be macros in the first place and they should be moved inside the #ifdef __cplusplus block.