Skip to content

Commit 4470063

Browse files
committed
core: fix macrs
1 parent 0104a9f commit 4470063

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

include/eigenpy/fwd.hpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@
1414
#endif
1515

1616
#define EIGENPY_STRING_LITERAL(string) #string
17+
#define EIGENPY_STRINGIZE(string) EIGENPY_STRING_LITERAL(string)
18+
#define _EIGENPY_PPCAT(A, B) A##B
19+
#define EIGENPY_PPCAT(A, B) _EIGENPY_PPCAT(A, B)
20+
#define EIGENPY_STRINGCAT(A, B) A B
1721

1822
// For more details, visit
1923
// https://stackoverflow.com/questions/171435/portability-of-warning-preprocessor-directive
2024
#if defined(EIGENPY_CLANG_COMPILER) || defined(EIGENPY_GCC_COMPILER)
2125
#define EIGENPY_PRAGMA(x) _Pragma(#x)
2226
#define EIGENPY_PRAGMA_MESSAGE(the_message) \
23-
EIGENPY_PRAGMA(GCC message #the_message)
27+
EIGENPY_PRAGMA(GCC message the_message)
2428
#define EIGENPY_PRAGMA_WARNING(the_message) \
25-
EIGENPY_PRAGMA(GCC warning #the_message)
29+
EIGENPY_PRAGMA(GCC warning the_message)
2630
#define EIGENPY_PRAGMA_DEPRECATED(the_message) \
27-
EIGENPY_PRAGMA_WARNING(Deprecated : #the_message)
31+
EIGENPY_PRAGMA_WARNING(Deprecated : the_message)
2832
#define EIGENPY_PRAGMA_DEPRECATED_HEADER(old_header, new_header) \
2933
EIGENPY_PRAGMA_WARNING( \
3034
Deprecated header file \
@@ -33,16 +37,17 @@
3337
#elif defined(WIN32)
3438
#define EIGENPY_PRAGMA(x) __pragma(#x)
3539
#define EIGENPY_PRAGMA_MESSAGE(the_message) \
36-
EIGENPY_PRAGMA(message(#the_message))
40+
EIGENPY_PRAGMA(message(EIGENPY_STRINGIZE(the_message)))
3741
#define EIGENPY_PRAGMA_WARNING(the_message) \
38-
EIGENPY_PRAGMA(message("WARNING: " #the_message))
42+
EIGENPY_PRAGMA(message("WARNING: " EIGENPY_STRINGIZE(the_message)))
3943
#endif
4044

4145
#define EIGENPY_DEPRECATED_MACRO(macro, the_message) \
42-
EIGENPY_PRAGMA_WARNING("this macro is deprecated: " the_message)
43-
#define EIGENPY_DEPRECATED_FILE(the_message) \
44-
EIGENPY_PRAGMA_WARNING(EIGENPY_STRING_LITERAL("this file is deprecated: ") \
45-
the_message)
46+
EIGENPY_PRAGMA_WARNING( \
47+
EIGENPY_STRINGCAT("this macro is deprecated: ", the_message))
48+
#define EIGENPY_DEPRECATED_FILE(the_message) \
49+
EIGENPY_PRAGMA_WARNING( \
50+
EIGENPY_STRINGCAT("this file is deprecated: ", the_message))
4651

4752
#include "eigenpy/config.hpp"
4853

0 commit comments

Comments
 (0)