|
6 | 6 |
|
7 | 7 | #include <sys_config.h> |
8 | 8 |
|
| 9 | +#ifdef __GNUC__ |
| 10 | + #define WSDDN_SUPPRESS_WARNINGS_BEGIN _Pragma("GCC diagnostic push") |
| 11 | + #define WSDDN_SUPPRESS_WARNING_HELPER0(arg) #arg |
| 12 | + #define WSDDN_SUPPRESS_WARNING_HELPER1(name) WSDDN_SUPPRESS_WARNING_HELPER0(GCC diagnostic ignored name) |
| 13 | + #define WSDDN_SUPPRESS_WARNING_HELPER2(name) WSDDN_SUPPRESS_WARNING_HELPER1(#name) |
| 14 | + #define WSDDN_SUPPRESS_WARNING(name) _Pragma(WSDDN_SUPPRESS_WARNING_HELPER2(name)) |
| 15 | + #define WSDDN_SUPPRESS_WARNINGS_END _Pragma("GCC diagnostic pop") |
| 16 | + |
| 17 | + #define WSDDN_IGNORE_DEPRECATED_BEGIN WSDDN_SUPPRESS_WARNINGS_BEGIN \ |
| 18 | + WSDDN_SUPPRESS_WARNING(-Wdeprecated-declarations) |
| 19 | + #define WSDDN_IGNORE_DEPRECATED_END WSDDN_SUPPRESS_WARNINGS_END |
| 20 | +#else |
| 21 | + #define WSDDN_SUPPRESS_WARNINGS_BEGIN |
| 22 | + #define WSDDN_SUPPRESS_WARNING(x) |
| 23 | + #define WSDDN_SUPPRESS_WARNINGS_END |
| 24 | + |
| 25 | + #define WSDDN_IGNORE_DEPRECATED_BEGIN |
| 26 | + #define WSDDN_IGNORE_DEPRECATED_END |
| 27 | +#endif |
| 28 | + |
9 | 29 | #include <argum/parser.h> |
10 | 30 | #include <argum/type-parsers.h> |
11 | 31 | #include <argum/validators.h> |
|
14 | 34 |
|
15 | 35 | //must come before sys_string due to S macro collision |
16 | 36 | #ifdef __clang__ |
17 | | -#pragma clang diagnostic push |
18 | | -#pragma clang diagnostic ignored "-Wshorten-64-to-32" |
| 37 | + WSDDN_SUPPRESS_WARNINGS_BEGIN |
| 38 | + WSDDN_SUPPRESS_WARNING(-Wshorten-64-to-32) |
19 | 39 | #endif |
20 | 40 | #include <asio.hpp> |
21 | 41 | #ifdef __clang__ |
22 | | -#pragma clang diagnostic pop |
| 42 | + WSDDN_SUPPRESS_WARNINGS_END |
23 | 43 | #endif |
24 | 44 |
|
25 | 45 | #include <sys_string/sys_string.h> |
|
0 commit comments