mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
Merge pull request #31193 from bfredl/winrt
refactor(windows)!: only support UCRT, even for mingw
This commit is contained in:
commit
92a83f671b
@ -45,6 +45,10 @@ API
|
||||
• Renamed `nvim__id_dictionary` (unsupported/experimental API) to
|
||||
`nvim__id_dict`.
|
||||
|
||||
BUILD
|
||||
|
||||
On Windows, only building with the UCRT runtime is supported.
|
||||
|
||||
DEFAULTS
|
||||
|
||||
• |]d-default| and |[d-default| accept a count.
|
||||
|
@ -120,8 +120,8 @@ elseif(MINGW)
|
||||
# Use POSIX compatible stdio in Mingw
|
||||
target_compile_definitions(main_lib INTERFACE __USE_MINGW_ANSI_STDIO)
|
||||
|
||||
# Enable wmain
|
||||
target_link_libraries(nvim_bin PRIVATE -municode)
|
||||
# wrapper for nvim.manifest
|
||||
target_sources(main_lib INTERFACE ${CMAKE_CURRENT_LIST_DIR}/os/nvim.rc)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(main_lib INTERFACE
|
||||
-Wno-conversion
|
||||
|
@ -111,6 +111,9 @@
|
||||
|
||||
#ifdef MSWIN
|
||||
# include "nvim/os/os_win_console.h"
|
||||
# ifndef _UCRT
|
||||
# error UCRT is the only supported C runtime on windows
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(MSWIN) && !defined(MAKE_LIB)
|
||||
@ -241,22 +244,10 @@ void early_init(mparm_T *paramp)
|
||||
#ifdef MAKE_LIB
|
||||
int nvim_main(int argc, char **argv); // silence -Wmissing-prototypes
|
||||
int nvim_main(int argc, char **argv)
|
||||
#elif defined(MSWIN)
|
||||
int wmain(int argc, wchar_t **argv_w) // multibyte args on Windows. #7060
|
||||
#else
|
||||
int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
#if defined(MSWIN) && !defined(MAKE_LIB)
|
||||
char **argv = xmalloc((size_t)argc * sizeof(char *));
|
||||
for (int i = 0; i < argc; i++) {
|
||||
char *buf = NULL;
|
||||
utf16_to_utf8(argv_w[i], -1, &buf);
|
||||
assert(buf);
|
||||
argv[i] = buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
argv0 = argv[0];
|
||||
|
||||
if (!appname_is_valid()) {
|
||||
|
2
src/nvim/os/nvim.rc
Normal file
2
src/nvim/os/nvim.rc
Normal file
@ -0,0 +1,2 @@
|
||||
#include "winuser.h"
|
||||
2 RT_MANIFEST nvim.manifest
|
@ -1,7 +1,4 @@
|
||||
add_library(test_lib INTERFACE)
|
||||
if(MINGW)
|
||||
target_link_libraries(test_lib INTERFACE -municode)
|
||||
endif()
|
||||
if(WIN32)
|
||||
target_compile_definitions(test_lib INTERFACE MSWIN)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user