From 0454f8b66e1f0992d0eced09a4fb989d6ad47328 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 19 Aug 2020 22:25:25 +0200 Subject: [PATCH] wip: simulator: guard GenerateHostEvent This feature is currently only available on Linux, but we don't want a platform-specific guard - not in itself, anyway - so guard it with `KALEIDOSCOPE_VIRTUAL_HOST_EVENTS`, _and_ a linux-guard within. Signed-off-by: Gergely Nagy --- .../simulator/actions/generic_report/GenerateHostEvent.cpp | 7 +++++++ .../simulator/actions/generic_report/GenerateHostEvent.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.cpp b/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.cpp index e50d95a6..1bf69897 100644 --- a/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.cpp +++ b/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.cpp @@ -18,6 +18,12 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD +#ifdef KALEIDOSCOPE_VIRTUAL_HOST_EVENTS + +#ifndef __linux__ +#error Generating host events is only supported on Linux at the moment. +#endif + #include "kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.h" #include "kaleidoscope/simulator/reports/BootKeyboardReport.h" #include "kaleidoscope/simulator/reports/KeyboardReport.h" @@ -396,4 +402,5 @@ bool GenerateHostEvent::Action::evalInternal() { #error __CLANG_ATOMIC_LLONG_LOCK_FREE #endif +#endif // KALEIDOSCOPE_VIRTUAL_HOST_EVENTS #endif // KALEIDOSCOPE_VIRTUAL_BUILD diff --git a/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.h b/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.h index 9ffbcb01..914d0c43 100644 --- a/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.h +++ b/src/kaleidoscope/simulator/actions/generic_report/GenerateHostEvent.h @@ -19,6 +19,7 @@ #pragma once #ifdef KALEIDOSCOPE_VIRTUAL_BUILD +#ifdef KALEIDOSCOPE_VIRTUAL_HOST_EVENTS #include "kaleidoscope/simulator/interface/actions/generic_report/ReportAction.h" #include "kaleidoscope/simulator/interface/reports/Report_.h" @@ -87,4 +88,5 @@ class GenerateHostEvent { } // namespace simulator } // namespace kaleidoscope +#endif // KALEIDOSCOPE_VIRTUAL_HOST_EVENTS #endif // KALEIDOSCOPE_VIRTUAL_BUILD