Skip to content

Commit

Permalink
backward compatibility with libconsole-bridge in Jessie (take 3) (#1235)
Browse files Browse the repository at this point in the history
* backward compatibility with libconsole-bridge in Jessie (take 3)

* copy-n-paste error

* remove fragile undef

* dont rely on existence of short version of the macros, define the long with API calls instead

* remove empty line
  • Loading branch information
mikaelarguedas authored and dirk-thomas committed Nov 16, 2017
1 parent f3c4ae8 commit 0542c4c
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions tools/rosbag_storage/include/rosbag/bag.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,23 @@
#include <boost/iterator/iterator_facade.hpp>

#include "console_bridge/console.h"
#if defined logDebug
# ifdef CONSOLE_BRIDGE_logDebug
# undef logDebug
# else
// Remove this when no longer supporting platforms with libconsole-bridge-dev < 0.3.0,
// in particular Debian Jessie: https://packages.debian.org/jessie/libconsole-bridge-dev
# define CONSOLE_BRIDGE_logDebug logDebug
# endif
#ifndef CONSOLE_BRIDGE_logDebug
# define CONSOLE_BRIDGE_logDebug(fmt, ...) \
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_DEBUG, fmt, ##__VA_ARGS__)
#endif
#if defined logInform
# undef logInform
#ifndef CONSOLE_BRIDGE_logInform
# define CONSOLE_BRIDGE_logInform(fmt, ...) \
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_INFO, fmt, ##__VA_ARGS__)
#endif
#if defined logWarn
# undef logWarn
#ifndef CONSOLE_BRIDGE_logWarn
# define CONSOLE_BRIDGE_logWarn(fmt, ...) \
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_WARN, fmt, ##__VA_ARGS__)
#endif
#if defined logError
# ifdef CONSOLE_BRIDGE_logError
# undef logError
# else
// Remove this when no longer supporting platforms with libconsole-bridge-dev < 0.3.0,
// in particular Debian Jessie: https://packages.debian.org/jessie/libconsole-bridge-dev
# define CONSOLE_BRIDGE_logError logError
# endif
#ifndef CONSOLE_BRIDGE_logError
# define CONSOLE_BRIDGE_logError(fmt, ...) \
console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_ERROR, fmt, ##__VA_ARGS__)
#endif

namespace rosbag {
Expand Down

0 comments on commit 0542c4c

Please sign in to comment.