From 2d9a83374760d3b2c36184710e103098566ec3ad Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 4 Jan 2022 17:42:35 +0100 Subject: uhd: Fix non-standard function name macros Throughout UHD, we are using a random mix of __FUNCTION__, __func__, __PRETTY_FUNCTION__, and BOOST_CURRENT_FUNCTION. Note that the first two macros are non-standard (although many compilers understand them), and the last requires Boost. __func__ is available since C++11, but is not the best choice because the C++ standard doesn't require it to be of any specific value. We thus define UHD_FUNCTION and UHD_PRETTY_FUNCTION as portable macros. The former simply contains the undecorated function name, the latter the expanded function with full signature. As it happens, our currently supported compilers didn't have any issues using non-standard macros, so the main fix here is the removal of the Boost macros and the harmonization of the other macros. --- host/lib/usrp/gps_ctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/gps_ctrl.cpp') diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index cafc2f662..8026b32a2 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -154,7 +154,7 @@ private: if (msg.length() < 6) { UHD_LOGGER_WARNING("GPS") - << __FUNCTION__ << ": Short GPSDO string: " << msg; + << UHD_FUNCTION << "(): Short GPSDO string: " << msg; continue; } @@ -166,7 +166,7 @@ private: msgs[msg.substr(1, 5)] = msg; } else { UHD_LOGGER_WARNING("GPS") - << __FUNCTION__ << ": Malformed GPSDO string: " << msg; + << UHD_FUNCTION << "(): Malformed GPSDO string: " << msg; } } -- cgit v1.2.3