mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	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:
		| @@ -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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Reed
					Michael Reed