diff options
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r-- | src/nvim/macros.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 3df7fa768d..0bbaa87aba 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -1,6 +1,8 @@ #ifndef NVIM_MACROS_H #define NVIM_MACROS_H +#include "auto/config.h" + // EXTERN is only defined in main.c. That's where global variables are // actually defined and initialized. #ifndef EXTERN @@ -203,16 +205,33 @@ # define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"") +# ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG +# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wimplicit-fallthrough\"") +# else +# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ + _Pragma("clang diagnostic push") +# endif # define PRAGMA_DIAG_POP \ _Pragma("clang diagnostic pop") #elif defined(__GNUC__) # define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"") +# ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG +# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") +# else +# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ + _Pragma("GCC diagnostic push") +# endif # define PRAGMA_DIAG_POP \ _Pragma("GCC diagnostic pop") #else # define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES +# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH # define PRAGMA_DIAG_POP #endif |