|
42 | 42 |
|
43 | 43 | #define SUPPRESS_BEGIN_(name) _Pragma("GCC diagnostic push") _Pragma(name)
|
44 | 44 |
|
| 45 | +#define SUPPRESS_END() _Pragma("GCC diagnostic pop") |
| 46 | + |
45 | 47 | #elif defined(_MSC_VER)
|
46 | 48 | #define SUPPRESS_BEGIN_UNIMPLEMENTED_() __pragma(warning(push))
|
47 | 49 |
|
48 | 50 | #define SUPPRESS_BEGIN_(name) \
|
49 | 51 | __pragma(warning(push)) __pragma(warning(disable : name))
|
50 | 52 |
|
| 53 | +#define SUPPRESS_END() __pragma(warning(pop)) |
| 54 | + |
| 55 | +#else |
| 56 | +#define SUPPRESS_BEGIN_UNIMPLEMENTED_() |
| 57 | +#define SUPPRESS_END() |
51 | 58 | #endif
|
52 | 59 |
|
53 | 60 | // 'Public' macros.
|
54 | 61 |
|
| 62 | +// Ignore -Wcomma warnings in Clang |
| 63 | +#if defined(__clang__) |
| 64 | +#define SUPPRESS_COMMA_WARNINGS_BEGIN() \ |
| 65 | + SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wcomma\"") |
| 66 | +#else |
| 67 | +#define SUPPRESS_COMMA_WARNINGS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() |
| 68 | +#endif |
| 69 | + |
| 70 | +// Ignore -Wdocumentation warnings in Clang |
55 | 71 | #if defined(__clang__)
|
56 | 72 | #define SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() \
|
57 | 73 | SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wdocumentation\"")
|
58 |
| - |
59 |
| -#define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() \ |
60 |
| - SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wdeprecated-declarations\"") |
61 |
| - |
62 |
| -#define SUPPRESS_END() _Pragma("GCC diagnostic pop") |
63 |
| - |
64 |
| -#elif defined(__GNUC__) |
| 74 | +#else |
65 | 75 | #define SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_()
|
| 76 | +#endif |
66 | 77 |
|
| 78 | +// Ignore the use of deprecated declarations. |
| 79 | +#if defined(__clang__) || defined(__GNUC__) |
67 | 80 | #define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() \
|
68 | 81 | SUPPRESS_BEGIN_("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
|
69 |
| - |
70 |
| -#define SUPPRESS_END() _Pragma("GCC diagnostic pop") |
71 |
| - |
72 | 82 | #elif defined(_MSC_VER)
|
73 | 83 | // MSVC compiler warnings can be found here: (Look at the navbar on the left
|
74 | 84 | // and select the appropriate range):
|
75 | 85 | // https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-by-compiler-version?view=vs-2017
|
76 |
| -#define SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() |
77 |
| - |
78 | 86 | #define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() SUPPRESS_BEGIN_(4995)
|
79 |
| - |
80 |
| -#define SUPPRESS_END() __pragma(warning(pop)) |
81 |
| - |
82 | 87 | #else
|
83 |
| -#define SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() |
84 |
| -#define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() |
85 |
| -#define SUPPRESS_END() |
86 |
| - |
| 88 | +#define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() |
87 | 89 | #endif
|
88 | 90 |
|
89 | 91 | #endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_WARNINGS_H_
|
0 commit comments