|
14 | 14 | #endif |
15 | 15 |
|
16 | 16 | #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 |
17 | 21 |
|
18 | 22 | // For more details, visit |
19 | 23 | // https://stackoverflow.com/questions/171435/portability-of-warning-preprocessor-directive |
20 | 24 | #if defined(EIGENPY_CLANG_COMPILER) || defined(EIGENPY_GCC_COMPILER) |
21 | 25 | #define EIGENPY_PRAGMA(x) _Pragma(#x) |
22 | 26 | #define EIGENPY_PRAGMA_MESSAGE(the_message) \ |
23 | | - EIGENPY_PRAGMA(GCC message #the_message) |
| 27 | + EIGENPY_PRAGMA(GCC message the_message) |
24 | 28 | #define EIGENPY_PRAGMA_WARNING(the_message) \ |
25 | | - EIGENPY_PRAGMA(GCC warning #the_message) |
| 29 | + EIGENPY_PRAGMA(GCC warning the_message) |
26 | 30 | #define EIGENPY_PRAGMA_DEPRECATED(the_message) \ |
27 | | - EIGENPY_PRAGMA_WARNING(Deprecated : #the_message) |
| 31 | + EIGENPY_PRAGMA_WARNING(Deprecated : the_message) |
28 | 32 | #define EIGENPY_PRAGMA_DEPRECATED_HEADER(old_header, new_header) \ |
29 | 33 | EIGENPY_PRAGMA_WARNING( \ |
30 | 34 | Deprecated header file \ |
|
33 | 37 | #elif defined(WIN32) |
34 | 38 | #define EIGENPY_PRAGMA(x) __pragma(#x) |
35 | 39 | #define EIGENPY_PRAGMA_MESSAGE(the_message) \ |
36 | | - EIGENPY_PRAGMA(message(#the_message)) |
| 40 | + EIGENPY_PRAGMA(message(EIGENPY_STRINGIZE(the_message))) |
37 | 41 | #define EIGENPY_PRAGMA_WARNING(the_message) \ |
38 | | - EIGENPY_PRAGMA(message("WARNING: " #the_message)) |
| 42 | + EIGENPY_PRAGMA(message("WARNING: " EIGENPY_STRINGIZE(the_message))) |
39 | 43 | #endif |
40 | 44 |
|
41 | 45 | #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)) |
46 | 51 |
|
47 | 52 | #include "eigenpy/config.hpp" |
48 | 53 |
|
|
0 commit comments