mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
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:
@@ -729,18 +729,11 @@ void nlua_push_Array(lua_State *lstate, const Array array, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
#define GENERATE_INDEX_FUNCTION(type) \
|
||||
void nlua_push_##type(lua_State *lstate, const type item, int flags) \
|
||||
FUNC_ATTR_NONNULL_ALL \
|
||||
{ \
|
||||
lua_pushnumber(lstate, (lua_Number)(item)); \
|
||||
}
|
||||
|
||||
GENERATE_INDEX_FUNCTION(Buffer)
|
||||
GENERATE_INDEX_FUNCTION(Window)
|
||||
GENERATE_INDEX_FUNCTION(Tabpage)
|
||||
|
||||
#undef GENERATE_INDEX_FUNCTION
|
||||
void nlua_push_handle(lua_State *lstate, const handle_T item, int flags)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
lua_pushnumber(lstate, (lua_Number)(item));
|
||||
}
|
||||
|
||||
/// Convert given Object to Lua value
|
||||
///
|
||||
|
@@ -9,6 +9,10 @@
|
||||
#define nlua_pop_Window nlua_pop_handle
|
||||
#define nlua_pop_Tabpage nlua_pop_handle
|
||||
|
||||
#define nlua_push_Buffer nlua_push_handle
|
||||
#define nlua_push_Window nlua_push_handle
|
||||
#define nlua_push_Tabpage nlua_push_handle
|
||||
|
||||
/// Flags for nlua_push_*() functions.
|
||||
enum {
|
||||
kNluaPushSpecial = 0x01, ///< Use lua-special-tbl when necessary
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <lua.h> // IWYU pragma: keep
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "lua/stdlib.h.generated.h"
|
||||
|
Reference in New Issue
Block a user