aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2022-01-04 17:42:35 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2022-01-12 15:07:54 -0600
commit2d9a83374760d3b2c36184710e103098566ec3ad (patch)
tree960df052e33b1f2671604a4858bfae5edfb3cc55 /host/lib/transport
parent85e61c7d8f520202d2de94e60ca47ed3d6948155 (diff)
downloaduhd-2d9a83374760d3b2c36184710e103098566ec3ad.tar.gz
uhd-2d9a83374760d3b2c36184710e103098566ec3ad.tar.bz2
uhd-2d9a83374760d3b2c36184710e103098566ec3ad.zip
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.
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/libusb1_base.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp
index 6808a3e0d..3cb190a6e 100644
--- a/host/lib/transport/libusb1_base.cpp
+++ b/host/lib/transport/libusb1_base.cpp
@@ -6,6 +6,7 @@
//
#include "libusb1_base.hpp"
+#include <uhd/config.hpp>
#include <uhd/exception.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/types/serial.hpp>
@@ -77,7 +78,7 @@ private:
throw uhd::io_error(libusb_strerror(LIBUSB_ERROR_NO_DEVICE));
default:
UHD_LOGGER_ERROR("USB")
- << __FUNCTION__ << ": " << libusb_strerror((libusb_error)ret);
+ << UHD_FUNCTION << ": " << libusb_strerror((libusb_error)ret);
break;
}
}