add output redirection to null device for C as well
This commit is contained in:
parent
5e12357d6c
commit
42279e29f2
@ -53,6 +53,17 @@ function! s:Unique(list)
|
|||||||
return l
|
return l
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" convenience function to determine the 'null device' parameter
|
||||||
|
" based on the current operating system
|
||||||
|
function! syntastic#c#GetNullDevice()
|
||||||
|
if has('win32')
|
||||||
|
return '-o nul'
|
||||||
|
elseif has('unix') || has('mac')
|
||||||
|
return '-o /dev/null'
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
" get the gcc include directory argument depending on the default
|
" get the gcc include directory argument depending on the default
|
||||||
" includes and the optional user-defined 'g:syntastic_c_include_dirs'
|
" includes and the optional user-defined 'g:syntastic_c_include_dirs'
|
||||||
function! syntastic#c#GetIncludeDirs(filetype)
|
function! syntastic#c#GetIncludeDirs(filetype)
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
"============================================================================
|
"============================================================================
|
||||||
|
|
||||||
" In order to also check header files add this to your .vimrc:
|
" In order to also check header files add this to your .vimrc:
|
||||||
" (this usually creates a .gch file in your source directory)
|
|
||||||
"
|
"
|
||||||
" let g:syntastic_c_check_header = 1
|
" let g:syntastic_c_check_header = 1
|
||||||
"
|
"
|
||||||
@ -108,6 +107,7 @@ function! SyntaxCheckers_c_GetLocList()
|
|||||||
if exists('g:syntastic_c_check_header')
|
if exists('g:syntastic_c_check_header')
|
||||||
let makeprg = 'gcc -c '.shellescape(expand('%')) .
|
let makeprg = 'gcc -c '.shellescape(expand('%')) .
|
||||||
\ ' ' . g:syntastic_c_compiler_options .
|
\ ' ' . g:syntastic_c_compiler_options .
|
||||||
|
\ ' ' . syntastic#c#GetNullDevice() .
|
||||||
\ ' ' . syntastic#c#GetIncludeDirs('c')
|
\ ' ' . syntastic#c#GetIncludeDirs('c')
|
||||||
else
|
else
|
||||||
return []
|
return []
|
||||||
|
@ -107,16 +107,9 @@ function! SyntaxCheckers_cpp_GetLocList()
|
|||||||
|
|
||||||
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
|
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
|
||||||
if exists('g:syntastic_cpp_check_header')
|
if exists('g:syntastic_cpp_check_header')
|
||||||
if has('win32')
|
|
||||||
let null_device = '-o nul'
|
|
||||||
elseif has('unix') || has('mac')
|
|
||||||
let null_device = '-o /dev/null'
|
|
||||||
else
|
|
||||||
let null_device = ''
|
|
||||||
endif
|
|
||||||
let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')) .
|
let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')) .
|
||||||
\ ' ' . g:syntastic_cpp_compiler_options .
|
\ ' ' . g:syntastic_cpp_compiler_options .
|
||||||
\ ' ' . null_device .
|
\ ' ' . syntastic#c#GetNullDevice() .
|
||||||
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
|
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
|
||||||
else
|
else
|
||||||
return []
|
return []
|
||||||
|
Loading…
Reference in New Issue
Block a user