Bug fix: b:cflags applies only to C and C++ checkers.

This commit is contained in:
LCD 47 2015-04-14 10:53:30 +03:00
parent fe436371b4
commit 2cf32d7be3
2 changed files with 10 additions and 10 deletions

View File

@ -221,12 +221,12 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2
let flags .= ' ' . s:_get_checker_var('g', a:ft, a:ck, 'compiler_options', '') . ' ' . s:_get_include_dirs(a:ft) let flags .= ' ' . s:_get_checker_var('g', a:ft, a:ck, 'compiler_options', '') . ' ' . s:_get_include_dirs(a:ft)
" check if the user manually set some cflags if a:ft ==# 'c' || a:ft ==# 'cpp'
let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '') " check if the user manually set some cflags
if b_cflags ==# '' let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '')
" check whether to search for include files at all if b_cflags ==# ''
if !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0) " check whether to search for include files at all
if a:ft ==# 'c' || a:ft ==# 'cpp' if !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0)
" refresh the include file search if desired " refresh the include file search if desired
if s:_get_checker_var('g', a:ft, a:ck, 'auto_refresh_includes', 0) if s:_get_checker_var('g', a:ft, a:ck, 'auto_refresh_includes', 0)
let flags .= ' ' . s:_search_headers() let flags .= ' ' . s:_search_headers()
@ -238,10 +238,10 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2
let flags .= ' ' . b:syntastic_{a:ft}_includes let flags .= ' ' . b:syntastic_{a:ft}_includes
endif endif
endif endif
else
" user-defined cflags
let flags .= ' ' . b_cflags
endif endif
else
" user-defined cflags
let flags .= ' ' . b_cflags
endif endif
" add optional config file parameters " add optional config file parameters

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.6.0-70' let g:_SYNTASTIC_VERSION = '3.6.0-71'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1