diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-02-04 03:43:38 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-02-04 13:16:59 +0100 |
commit | 45f25f7e0b3f105faebf5e215e5c128346463046 (patch) | |
tree | 658cd7ff2874f3ff3fa98a9279cf5f8e5737463a /src/nvim/macros.h | |
parent | f2c6164b04709b83b60483642ed9b6f33cf01951 (diff) | |
download | rneovim-45f25f7e0b3f105faebf5e215e5c128346463046.tar.gz rneovim-45f25f7e0b3f105faebf5e215e5c128346463046.tar.bz2 rneovim-45f25f7e0b3f105faebf5e215e5c128346463046.zip |
build: PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
On Travis CI, -Wmissing-prototypes gives strange error:
In file included from ../src/nvim/eval.c:5965:
/home/travis/build/neovim/neovim/build/src/nvim/auto/funcs.generated.h.gperf:215:1: error: conflicting types for 'find_internal_func_gperf'
find_internal_func_gperf (register const char *str, register unsigned int len)
^
../src/nvim/eval.c:5962:20: note: previous declaration is here
const VimLFuncDef *find_internal_func_gperf(register const char *str,
^
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r-- | src/nvim/macros.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h index d447bff765..61009528a8 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -198,4 +198,25 @@ # define IO_COUNT(x) (x) #endif +/// +/// PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES +/// +#if defined(__clang__) && __clang__ == 1 +# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"") +# 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\"") +# define PRAGMA_DIAG_POP \ + _Pragma("GCC diagnostic pop") +#else +# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES +# define PRAGMA_DIAG_POP +#endif + + #endif // NVIM_MACROS_H |