From 6b9fa2b628eeb841d09efceda76062328ebab16b Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 16 May 2022 22:09:11 +1000 Subject: [PATCH] [host] capture: fix compilation with NvFBC C++ sources The prior commit to expose the FrameBuffer internals makes use of an atomic from `stdatomic.h`. Unfortunatly C++ has no notion of _Atomic and as such `stdatomic.h` is not compatible. To work around this we instead just forward declare the type here. --- host/include/interface/capture.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/host/include/interface/capture.h b/host/include/interface/capture.h index b7fdd38b..4db37f02 100644 --- a/host/include/interface/capture.h +++ b/host/include/interface/capture.h @@ -22,9 +22,16 @@ #include #include -#include "common/framebuffer.h" #include "common/KVMFR.h" +#ifdef __cplusplus +/* using common/framebuffer.h breaks compatibillity with C++ due to it's usage + * of stdatomic.h, so we need to forward declare the structure here */ +typedef struct stFrameBuffer FrameBuffer; +#else +#include "common/framebuffer.h" +#endif + typedef enum CaptureResult { CAPTURE_RESULT_OK ,