From 852aaa5d4208f32f7485c20a78c9af88da83e8de Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Tue, 12 Jan 2016 16:08:21 -0500 Subject: shada.c: Fix HAVE_BE64TOH check Mentioned here: https://github.com/neovim/neovim/pull/3985#issuecomment-170663426 HAVE_BE64TOH is defined in `config/config.h', which is included by `vim.h'. Since the HAVE_BE64TOH check in `shada.c' is evaluated before `vim.h' is included, it always evaluates to false, meaning that be64toh() in shada.c is always used instead of the one in . Moving the HAVE_BE64TOH block to after where `vim.h' is included seems to fix the issue. --- src/nvim/shada.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 347bd8664c..59ef2a0d28 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -1,8 +1,3 @@ -#ifdef HAVE_BE64TOH -# define _BSD_SOURCE 1 -# define _DEFAULT_SOURCE 1 -# include -#endif #include #include #include @@ -49,6 +44,12 @@ #include "nvim/lib/khash.h" #include "nvim/lib/kvec.h" +#ifdef HAVE_BE64TOH +# define _BSD_SOURCE 1 +# define _DEFAULT_SOURCE 1 +# include +#endif + // Note: when using bufset hash pointers are intentionally casted to uintptr_t // and not to khint32_t or khint64_t: this way compiler must give a warning // (-Wconversion) when types change. -- cgit