Skip to content

Commit ab9339a

Browse files
committed
MacOS fixes
1 parent d8261de commit ab9339a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ The CMake options below controls how to build CeDImu and the build macros listed
104104

105105
`LIBCEDIMU_ENABLE_ASAN`: if true, uses address sanitizer for GCC and clang (MSVC not yet supported) (default: `OFF`).
106106

107+
`LIBCEDIMU_REBUILD_SOFTCDI`: If ON, will build the SoftCDI modules from sources (requires DOSBox). If OFF, will use the prebuilt module binaries (default: `OFF`).
108+
107109
`CEDIMU_BUILD_CDITOOL`: If ON, builds the little `cditool` program (Linux only, requires libcdio) (default: `OFF`).
108110

109111
`CEDIMU_BENCHMARKS`: if ON, builds the benchmarks (default: `OFF`).
@@ -114,8 +116,6 @@ The CMake options below controls how to build CeDImu and the build macros listed
114116

115117
`CEDIMU_ENABLE_LTO`: If ON, compiles the executable with link-time optimisations (default: `ON`).
116118

117-
`LIBCEDIMU_REBUILD_SOFTCDI`: If ON, will build the SoftCDI modules from sources (requires DOSBox). If OFF, will use the prebuilt module binaries (default: `OFF`).
118-
119119
#### Windows
120120

121121
First install [CMake](https://cmake.org/download/) and [vcpkg](https://github.com/microsoft/vcpkg/), and use vcpkg to install wxWidgets: `vcpkg.exe install wxwidgets:x64-windows-static`

src/CDI/CDI.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "boards/Mono3SoftCDI/Mono3SoftCDI.hpp"
44
#include "boards/SoftCDI/SoftCDI.hpp"
55

6+
#include <version>
7+
68
/** \brief Creates a new CD-i instance.
79
* \param board The type of board to use.
810
* \param useSoftCDI false to use the regular LLE emulator, true to use some SoftCDI modules.
@@ -176,11 +178,20 @@ std::span<const uint8_t> CDI::GetPointer(const uint32_t addr) const noexcept
176178
{
177179
const RAMBank ram1 = GetRAMBank1();
178180
if(addr >= ram1.base && addr < ram1.base + ram1.data.size())
181+
#if __cpp_lib_ranges_as_const >= 202207L
179182
return {ram1.data.cbegin() + (addr - ram1.base), ram1.data.cend()};
183+
#else
184+
return {ram1.data.begin() + (addr - ram1.base), ram1.data.end()};
185+
#endif
186+
// LLVM doesn't implement it yet.
180187

181188
const RAMBank ram2 = GetRAMBank2();
182189
if(addr >= ram2.base && addr < ram2.base + ram2.data.size())
190+
#if __cpp_lib_ranges_as_const >= 202207L
183191
return {ram2.data.cbegin() + (addr - ram2.base), ram2.data.cend()};
192+
#else
193+
return {ram2.data.begin() + (addr - ram2.base), ram2.data.end()};
194+
#endif
184195

185196
const OS9::BIOS& bios = GetBIOS();
186197
const uint32_t base = GetBIOSBaseAddress();

src/CDI/common/utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define CDI_COMMON_UTILS_HPP
77

88
#include <algorithm>
9+
#include <bit>
910
#include <concepts>
1011
#include <cstdint>
1112
#include <cstring>

0 commit comments

Comments
 (0)