posemath.h: replace some macros with function templates.
posemath.h contains some macros for conversion between C structs and C++
classes. Those macros are named like 'toLine' and don't follow usual
convention that #define should use CAPITALIZED_NAMES. To avoid
name collisions, replace macros with function templates and make sure
those are only enabled if compiled as C++.
posemath.h: replace some macros with function templates.
posemath.h contains some macros for conversion between C structs and C++ classes. Those macros are named like 'toLine' and don't follow usual convention that #define should use CAPITALIZED_NAMES. To avoid name collisions, replace macros with function templates and make sure those are only enabled if compiled as C++.