xo-umbrella2/xo-indentlog/include/xo/indentlog/machdep/machdep.hpp
Roland Conybeare 966c3903e1 git subrepo clone git@github.com:Rconybea/xo-indentlog.git xo-indentlog
subrepo:
  subdir:   "xo-indentlog"
  merged:   "0834c6ad"
upstream:
  origin:   "git@github.com:Rconybea/xo-indentlog.git"
  branch:   "main"
  commit:   "0834c6ad"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 21:30:17 -04:00

29 lines
805 B
C++

/* @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_rdtsc();
unsigned int fake_mm_getcsr();
unsigned int fake_mm_setcsr();
}
/* __rdtsc: clang encounters this from <immintrin.h>, for example */
#define __rdtsc() fake_rdtsc()
#define _mm_getcsr(a) fake_mm_getcsr()
#define _mm_setcsr(a) fake_mm_setcsr()
#endif
/* end machdep.hpp */