diff options
author | Michael Reed <m.reed@mykolab.com> | 2016-01-12 16:08:21 -0500 |
---|---|---|
committer | Michael Reed <m.reed@mykolab.com> | 2016-01-13 15:56:20 -0500 |
commit | 852aaa5d4208f32f7485c20a78c9af88da83e8de (patch) | |
tree | d1082b085bb8461d6f514c41df564d6bce84ee95 /src/nvim/shada.c | |
parent | 7f3999ac806daefa078b4db0781bfc1e190e135e (diff) | |
download | rneovim-852aaa5d4208f32f7485c20a78c9af88da83e8de.tar.gz rneovim-852aaa5d4208f32f7485c20a78c9af88da83e8de.tar.bz2 rneovim-852aaa5d4208f32f7485c20a78c9af88da83e8de.zip |
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 <endian.h>.
Moving the HAVE_BE64TOH block to after where `vim.h' is included seems
to fix the issue.
Diffstat (limited to 'src/nvim/shada.c')
-rw-r--r-- | src/nvim/shada.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 <endian.h> -#endif #include <stdlib.h> #include <stddef.h> #include <stdbool.h> @@ -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 <endian.h> +#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. |