Skip to content

Commit

Permalink
OS/impl: Use full class name in macros
Browse files Browse the repository at this point in the history
This only worked because we have "using namespace yarp::os::impl" almost
everywhere.
  • Loading branch information
drdanz committed Mar 14, 2018
1 parent 90e988b commit 166e6e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libYARP_OS/include/yarp/os/impl/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ class YARP_OS_impl_API yarp::os::impl::Logger : public yarp::os::Log
// compromise - use macros so that debugging can evaporate in optimized code.
// also, make a printf-style adaptor since c++ is a bit of a pain to
// build strings in.
#define YARP_ERROR(log, x) ((Logger*)&(log))->internal_error(x)
#define YARP_WARN(log, x) ((Logger*)&(log))->internal_warning(x)
#define YARP_INFO(log, x) ((Logger*)&(log))->internal_info(x)
#define YARP_ERROR(log, x) ((yarp::os::impl::Logger*)&(log))->internal_error(x)
#define YARP_WARN(log, x) ((yarp::os::impl::Logger*)&(log))->internal_warning(x)
#define YARP_INFO(log, x) ((yarp::os::impl::Logger*)&(log))->internal_info(x)
#ifndef NDEBUG
# define YARP_DEBUG(log, x) ((Logger*)&(log))->internal_debug(x)
# define YARP_DEBUG(log, x) ((yarp::os::impl::Logger*)&(log))->internal_debug(x)
#else
# define YARP_DEBUG(log, x) YARP_UNUSED(log)
#endif
#define YARP_FAIL(log, x) ((Logger*)&(log))->internal_fail(x)
#define YARP_FAIL(log, x) ((yarp::os::impl::Logger*)&(log))->internal_fail(x)

#define YARP_LONGEST_MESSAGE 1000
#define YARP_SPRINTF0(log, mode, msg) { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg); (log).internal_ ## mode(&(_yarp_buf[0])); }
Expand Down

0 comments on commit 166e6e1

Please sign in to comment.