refactor(build): graduate unibilium VAR_FROM feature from 2017
This commit is contained in:
parent
c9b6db4541
commit
848dac0aaa
|
@ -8,22 +8,4 @@ add_library(unibilium INTERFACE)
|
|||
target_include_directories(unibilium SYSTEM BEFORE INTERFACE ${UNIBILIUM_INCLUDE_DIR})
|
||||
target_link_libraries(unibilium INTERFACE ${UNIBILIUM_LIBRARY})
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIR}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}")
|
||||
check_c_source_compiles("
|
||||
#include <unibilium.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
unibi_str_from_var(unibi_var_from_str(\"\"));
|
||||
return unibi_num_from_var(unibi_var_from_num(0));
|
||||
}
|
||||
" UNIBI_HAS_VAR_FROM)
|
||||
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIR}")
|
||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}")
|
||||
if(UNIBI_HAS_VAR_FROM)
|
||||
target_compile_definitions(unibilium INTERFACE NVIM_UNIBI_HAS_VAR_FROM)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)
|
||||
|
|
|
@ -60,27 +60,14 @@
|
|||
#define LINUXSET0C "\x1b[?0c"
|
||||
#define LINUXSET1C "\x1b[?1c"
|
||||
|
||||
#ifdef NVIM_UNIBI_HAS_VAR_FROM
|
||||
# define UNIBI_SET_NUM_VAR(var, num) \
|
||||
#define UNIBI_SET_NUM_VAR(var, num) \
|
||||
do { \
|
||||
(var) = unibi_var_from_num((num)); \
|
||||
} while (0)
|
||||
# define UNIBI_SET_STR_VAR(var, str) \
|
||||
#define UNIBI_SET_STR_VAR(var, str) \
|
||||
do { \
|
||||
(var) = unibi_var_from_str((str)); \
|
||||
} while (0)
|
||||
#else
|
||||
# define UNIBI_SET_NUM_VAR(var, num) \
|
||||
do { \
|
||||
(var).p = NULL; \
|
||||
(var).i = (num); \
|
||||
} while (0)
|
||||
# define UNIBI_SET_STR_VAR(var, str) \
|
||||
do { \
|
||||
(var).i = INT_MIN; \
|
||||
(var).p = str; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int top, bot, left, right;
|
||||
|
|
Loading…
Reference in New Issue