diff options
author | Guy Harris <gharris@sonic.net> | 2020-07-03 16:26:06 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-07-03 16:26:06 -0700 |
commit | 505e35489a11a8dbbd5e3909e587608b7903eb5b (patch) | |
tree | 6d528d5c71c1aa200d793236e89d0b908318b1e1 /diag-control.h | |
parent | 992591533d502bf26526fe94362712b38b1a8391 (diff) |
bpf_filter: suppress "switch has only a default case" warning.
Diffstat (limited to 'diag-control.h')
-rw-r--r-- | diag-control.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/diag-control.h b/diag-control.h index 28ecca42..8fce70e5 100644 --- a/diag-control.h +++ b/diag-control.h @@ -68,6 +68,22 @@ #endif /* + * Suppress "switch statement has only a default case" warnings. + * There's a switch in bpf_filter.c that only has additional + * cases on Linux. + */ +#if defined(_MSC_VER) + #define DIAG_OFF_DEFAULT_ONLY_SWITCH \ + __pragma(warning(push)) \ + __pragma(warning(disable:4065)) + #define DIAG_ON_DEFAULT_ONLY_SWITCH \ + __pragma(warning(pop)) +#else + #define DIAG_OFF_DEFAULT_ONLY_SWITCH + #define DIAG_ON_DEFAULT_ONLY_SWITCH +#endif + +/* * Suppress Flex, narrowing, and deprecation warnings. */ #if defined(_MSC_VER) |