diff options
author | Michael Forney <mforney@mforney.org> | 2019-08-15 18:49:51 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-08-16 05:42:03 (GMT) |
commit | 1a88619b72c77b5390076ad703bfa3de4fa0348d (patch) | |
tree | 806a32188609685e8e2b74622841d87d5a579990 | |
parent | 4ecb346c7c7392e918f9bc03bc8cd200f96e4c63 (diff) | |
download | libnl-1a88619b72c77b5390076ad703bfa3de4fa0348d.zip libnl-1a88619b72c77b5390076ad703bfa3de4fa0348d.tar.gz libnl-1a88619b72c77b5390076ad703bfa3de4fa0348d.tar.bz2 |
dbg: Use __func__ instead of __PRETTY_FUNCTION__
These behave the same, except when used at top-level. This can't happen
since the macro body is a statement.
__func__ is standardized since C99, while __PRETTY_FUNCTION__ is a
GNU extension.
-rw-r--r-- | include/netlink-private/netlink.h | 6 | ||||
-rw-r--r-- | lib/xfrm/ae.c | 2 | ||||
-rw-r--r-- | lib/xfrm/sa.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/netlink-private/netlink.h b/include/netlink-private/netlink.h index 728ca5c..8240bb2 100644 --- a/include/netlink-private/netlink.h +++ b/include/netlink-private/netlink.h @@ -90,7 +90,7 @@ struct trans_list { fprintf(stderr, \ "DBG<" #LVL ">%20s:%-4u %s: " FMT, \ __FILE__, __LINE__, \ - __PRETTY_FUNCTION__, ##ARG); \ + __func__, ##ARG); \ errno = _errsv; \ } \ } while (0) @@ -101,7 +101,7 @@ struct trans_list { #define BUG() \ do { \ fprintf(stderr, "BUG at file position %s:%d:%s\n", \ - __FILE__, __LINE__, __PRETTY_FUNCTION__); \ + __FILE__, __LINE__, __func__); \ assert(0); \ } while (0) @@ -115,7 +115,7 @@ struct trans_list { #define APPBUG(msg) \ do { \ fprintf(stderr, "APPLICATION BUG: %s:%d:%s: %s\n", \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, msg); \ + __FILE__, __LINE__, __func__, msg); \ assert(0); \ } while(0) diff --git a/lib/xfrm/ae.c b/lib/xfrm/ae.c index 99a174a..c7baf35 100644 --- a/lib/xfrm/ae.c +++ b/lib/xfrm/ae.c @@ -599,7 +599,7 @@ int xfrmnl_ae_build_get_request(struct nl_addr* daddr, unsigned int spi, unsigne if (!daddr || !spi) { fprintf(stderr, "APPLICATION BUG: %s:%d:%s: A valid destination address, spi must be specified\n", - __FILE__, __LINE__, __PRETTY_FUNCTION__); + __FILE__, __LINE__, __func__); assert(0); return -NLE_MISSING_ATTR; } diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c index 14c05e8..b469b0a 100644 --- a/lib/xfrm/sa.c +++ b/lib/xfrm/sa.c @@ -1032,7 +1032,7 @@ int xfrmnl_sa_build_get_request(struct nl_addr* daddr, unsigned int spi, unsigne if (!daddr || !spi) { fprintf(stderr, "APPLICATION BUG: %s:%d:%s: A valid destination address, spi must be specified\n", - __FILE__, __LINE__, __PRETTY_FUNCTION__); + __FILE__, __LINE__, __func__); assert(0); return -NLE_MISSING_ATTR; } |