Skip to content

Commit

Permalink
Checking MSVC predefined macro. (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyen authored and dirk-thomas committed Aug 6, 2020
1 parent b2e2b98 commit 4fd1671
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions include/ros/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,10 @@

#include <ros/platform.h>

#ifdef WIN32
# if defined (__MINGW32__)
# define ROS_ISSUE_BREAK() DebugBreak();
# else // MSVC
# define ROS_ISSUE_BREAK() __debugbreak();
# endif
#if defined(__MINGW32__)
# define ROS_ISSUE_BREAK() DebugBreak();
#elif defined(_MSC_VER)
# define ROS_ISSUE_BREAK() __debugbreak();
#elif defined(__powerpc64__)
# define ROS_ISSUE_BREAK() asm volatile ("tw 31,1,1");
#elif defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
Expand Down
4 changes: 2 additions & 2 deletions include/ros/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ ROSCONSOLE_DECL std::string formatToString(const char* fmt, ...);
} // namespace console
} // namespace ros

#ifdef WIN32
#if defined(_MSC_VER)
#define ROS_LIKELY(x) (x)
#define ROS_UNLIKELY(x) (x)
#else
#define ROS_LIKELY(x) __builtin_expect((x),1)
#define ROS_UNLIKELY(x) __builtin_expect((x),0)
#endif

#if defined(MSVC)
#if defined(_MSC_VER)
#define __ROSCONSOLE_FUNCTION__ __FUNCSIG__
#elif defined(__GNUC__)
#define __ROSCONSOLE_FUNCTION__ __PRETTY_FUNCTION__
Expand Down
2 changes: 1 addition & 1 deletion src/rosconsole/rosconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ log4cxx::LevelPtr g_level_lookup[levels::Count] =
#endif
std::string g_last_error_message = "Unknown Error";

#ifdef WIN32
#ifdef _WIN32
#define COLOR_NORMAL ""
#define COLOR_RED ""
#define COLOR_GREEN ""
Expand Down

0 comments on commit 4fd1671

Please sign in to comment.