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.
This commit is contained in:
Michael Reed
2016-01-12 16:08:21 -05:00
parent 7f3999ac80
commit 852aaa5d42

View File

@@ -1,8 +1,3 @@
#ifdef HAVE_BE64TOH
# define _BSD_SOURCE 1
# define _DEFAULT_SOURCE 1
# include <endian.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
@@ -49,6 +44,12 @@
#include "nvim/lib/khash.h" #include "nvim/lib/khash.h"
#include "nvim/lib/kvec.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 // 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 // and not to khint32_t or khint64_t: this way compiler must give a warning
// (-Wconversion) when types change. // (-Wconversion) when types change.