refactor(build): don't use the preprocessor when generating headers

Using the preprocessor before generating prototypes provides some
"niceties" but the places that rely on these are pretty few.
Vastly simplifying the BUILD SYSTEM is a better trade-off.

Unbalancing { } blocks due to the preprocessor is cringe anyway (think
of the tree-sitter trees!), write these in a different way.

Add some workarounds for plattform specific features.

INCLUDE_GENERATED_DECLARATIONS flag is now technically redundant,
but will be cleaned up in a follow-up PR as it is a big mess.
This commit is contained in:
bfredl
2025-08-01 12:26:52 +02:00
parent b4c092a092
commit 79c8159f41
24 changed files with 74 additions and 143 deletions

View File

@@ -3003,7 +3003,7 @@ static void shada_free_shada_entry(ShadaEntry *const entry)
}
#ifndef HAVE_BE64TOH
static inline uint64_t be64toh(uint64_t big_endian_64_bits)
static inline uint64_t vim_be64toh(uint64_t big_endian_64_bits)
{
# ifdef ORDER_BIG_ENDIAN
return big_endian_64_bits;
@@ -3019,6 +3019,7 @@ static inline uint64_t be64toh(uint64_t big_endian_64_bits)
return ret;
# endif
}
# define be64toh vim_be64toh
#endif
/// Read given number of bytes into given buffer, display error if needed