From 48dbe22e3242ff847c0f5523e42db4e328212193 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 1 Jun 2026 13:39:20 -0700 Subject: [PATCH] pcem: fit graphics sources into C++ builds WinUAE builds the imported PCem graphics sources as C++ files. The MGA source includes C atomics directly, and the BT482 RAMDAC source uses C allocation declarations through C++ headers. Use C++ atomics when compiling MGA as C++, and include the C++ cstdlib wrapper where the BT482 RAMDAC needs those declarations. --- pcem/vid_bt482_ramdac.cpp | 1 + pcem/vid_mga.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pcem/vid_bt482_ramdac.cpp b/pcem/vid_bt482_ramdac.cpp index 9c4d8264..1737acec 100644 --- a/pcem/vid_bt482_ramdac.cpp +++ b/pcem/vid_bt482_ramdac.cpp @@ -2,6 +2,7 @@ /* BT482 RAMDAC (based on 86box BT484) */ #include +#include #include "ibm.h" #include "mem.h" #include "device.h" diff --git a/pcem/vid_mga.cpp b/pcem/vid_mga.cpp index 891b1d8d..329f8bc2 100644 --- a/pcem/vid_mga.cpp +++ b/pcem/vid_mga.cpp @@ -20,7 +20,14 @@ #include #include #include +#ifdef __cplusplus +#include +using std::atomic_bool; +using std::atomic_int; +using std::atomic_uint; +#else #include +#endif #include "ibm.h" #include "device.h" #include "io.h" -- 2.47.3