diff --git a/syntax_checkers/cpp.vim b/syntax_checkers/cpp.vim index 71e6fe2c..eeb4d839 100644 --- a/syntax_checkers/cpp.vim +++ b/syntax_checkers/cpp.vim @@ -11,7 +11,6 @@ "============================================================================ " 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_cpp_check_header = 1 " @@ -108,8 +107,16 @@ function! SyntaxCheckers_cpp_GetLocList() if expand('%') =~? '\%(.h\|.hpp\|.hh\)$' 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('%')) . \ ' ' . g:syntastic_cpp_compiler_options . + \ ' ' . null_device . \ ' ' . syntastic#c#GetIncludeDirs('cpp') else return []