diff options
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | cmake/GenerateHelptags.cmake | 2 | ||||
-rw-r--r-- | cmake/RunTests.cmake | 2 | ||||
-rw-r--r-- | runtime/autoload/remote/host.vim | 11 | ||||
-rw-r--r-- | test/functional/api/window_spec.lua | 4 |
5 files changed, 25 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0241b0502c..d2b5217658 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,8 +73,19 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion") # gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently # does not work with Neovim due to some uses of dynamically-sized structures. # See https://github.com/neovim/neovim/issues/223 for details. -if(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "4" - AND CMAKE_BUILD_TYPE MATCHES "^Rel") +include(CheckCSourceCompiles) +check_c_source_compiles(" +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1 +#error \"_FORTIFY_SOURCE > 1\" +#endif +int +main(void) +{ + return 0; +} +" _FORTIFY_SOURCE_ACCEPTABLE) + +if(NOT _FORTIFY_SOURCE_ACCEPTABLE) # -U in add_definitions doesn't end up in the correct spot, so we add it to # the flags variable instead. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1") diff --git a/cmake/GenerateHelptags.cmake b/cmake/GenerateHelptags.cmake index 090cdf8ef4..658f4ab9cc 100644 --- a/cmake/GenerateHelptags.cmake +++ b/cmake/GenerateHelptags.cmake @@ -22,5 +22,5 @@ execute_process( RESULT_VARIABLE res) if(NOT res EQUAL 0) - message(FATAL_ERROR "Generating helptags failed: ${err}") + message(FATAL_ERROR "Generating helptags failed: ${err} - ${res}") endif() diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 0f301a6a10..227569f84c 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -20,5 +20,5 @@ execute_process( RESULT_VARIABLE res) if(NOT res EQUAL 0) - message(FATAL_ERROR "Running ${TEST_TYPE} tests failed.") + message(FATAL_ERROR "Running ${TEST_TYPE} tests failed with error: ${res}.") endif() diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index e81aa81665..b07593f39b 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -219,7 +219,9 @@ function! s:RequirePythonHost(name) " In some distros, python3 is the default python let python_host_prog = 'python2' else - throw 'No python interpreter found' + throw 'No python interpreter found.' . + \ " Try setting 'let g:python_host_prog=/path/to/python' in your '.nvimrc'" . + \ " or see ':help nvim-python'." endif " Make sure we pick correct python version on path. @@ -231,7 +233,8 @@ function! s:RequirePythonHost(name) let import_result = system(python_host_prog . \ ' -c "import neovim, sys; sys.stdout.write(\"ok\")"') if import_result != 'ok' - throw 'No neovim module found for ' . python_version + throw 'No neovim module found for ' . python_version . '.' . + \ " Try installing it with 'pip install neovim' or see ':help nvim-python'." endif try @@ -241,7 +244,9 @@ function! s:RequirePythonHost(name) endif catch endtry - throw 'Failed to load python host' + throw 'Failed to load python host.' . + \ " Try upgrading the Neovim python module with 'pip install --upgrade neovim'" . + \ " or see ':help nvim-python'." endfunction call remote#host#Register('python', function('s:RequirePythonHost')) diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 4c867d2f5d..f3ac90de21 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -104,7 +104,7 @@ describe('window_* functions', function() nvim('set_current_window', nvim('get_windows')[2]) nvim('command', 'split') eq(window('get_height', nvim('get_windows')[2]), - window('get_height', nvim('get_windows')[1]) / 2) + math.floor(window('get_height', nvim('get_windows')[1]) / 2)) window('set_height', nvim('get_windows')[2], 2) eq(2, window('get_height', nvim('get_windows')[2])) end) @@ -118,7 +118,7 @@ describe('window_* functions', function() nvim('set_current_window', nvim('get_windows')[2]) nvim('command', 'vsplit') eq(window('get_width', nvim('get_windows')[2]), - window('get_width', nvim('get_windows')[1]) / 2) + math.floor(window('get_width', nvim('get_windows')[1]) / 2)) window('set_width', nvim('get_windows')[2], 2) eq(2, window('get_width', nvim('get_windows')[2])) end) |