lsp: prevent some false complaints from LSP clang seeing gcc headers
This commit is contained in:
parent
d42d29fa52
commit
8bbf326805
1 changed files with 26 additions and 0 deletions
26
include/xo/indentlog/machdep/machdep.hpp
Normal file
26
include/xo/indentlog/machdep/machdep.hpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* @file machdep.hpp */
|
||||
|
||||
#pragma once
|
||||
|
||||
/** Carveout for LSP (language server process):
|
||||
LSP uses clang, but with the same compiler flags as primary build.
|
||||
This triggers a handful of false alarms, in which clang complains about
|
||||
gcc builtins.
|
||||
|
||||
Replace these with something innocuous. Ok since LSP stops
|
||||
once parsing completes and does not generate code
|
||||
**/
|
||||
#if __clang__ && __GNUG__
|
||||
|
||||
extern "C" {
|
||||
/* never defined! must not ever generate code that relies on these */
|
||||
unsigned int fake_mm_getcsr();
|
||||
unsigned int fake_mm_setcsr(unsigned int a);
|
||||
}
|
||||
|
||||
#define _mm_getcsr(a) fake_mm_getcsr()
|
||||
#define _mm_setcsr(a) fake_mm_setcsr(a)
|
||||
|
||||
#endif
|
||||
|
||||
/* end machdep.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue