diff --git a/include/xo/indentlog/machdep/machdep.hpp b/include/xo/indentlog/machdep/machdep.hpp new file mode 100644 index 00000000..11c2f3e9 --- /dev/null +++ b/include/xo/indentlog/machdep/machdep.hpp @@ -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 */