diff options
author | James McCoy <jamessan@jamessan.com> | 2020-08-26 07:13:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 07:13:27 -0400 |
commit | 91109ffda23d0ce61cec245b1f4ffb99e7591b62 (patch) | |
tree | 2268ae922351378e01a607d09d1b98ec1a04c2fd /src/nvim/macros.h | |
parent | 43202964f39eed4e28fd8ad6ad0ec79a1868c33f (diff) | |
parent | 1f84ea061dc111ec1a99c8cb24fcbf00578efdbd (diff) | |
download | rneovim-91109ffda23d0ce61cec245b1f4ffb99e7591b62.tar.gz rneovim-91109ffda23d0ce61cec245b1f4ffb99e7591b62.tar.bz2 rneovim-91109ffda23d0ce61cec245b1f4ffb99e7591b62.zip |
Merge pull request #12510 from jamessan/clang-implicit-fallthrough
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 |