diff --git a/Source/Core/Common/CDUtils.cpp b/Source/Core/Common/CDUtils.cpp index c829189cf9..d3f0221fef 100644 --- a/Source/Core/Common/CDUtils.cpp +++ b/Source/Core/Common/CDUtils.cpp @@ -34,6 +34,8 @@ #include #endif +namespace Common +{ #ifdef _WIN32 // takes a root drive path, returns true if it is a cdrom drive bool is_cdrom(const TCHAR* drive) @@ -219,3 +221,4 @@ bool cdio_is_cdrom(std::string device) } return false; } +} // namespace Common diff --git a/Source/Core/Common/CDUtils.h b/Source/Core/Common/CDUtils.h index 8c768dac37..f74f10640a 100644 --- a/Source/Core/Common/CDUtils.h +++ b/Source/Core/Common/CDUtils.h @@ -7,8 +7,11 @@ #include #include +namespace Common +{ // Returns a pointer to an array of strings with the device names std::vector cdio_get_devices(); // Returns true if device is cdrom/dvd bool cdio_is_cdrom(std::string device); +} // namespace Common diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 28e52119f9..6c868cbf88 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -62,7 +62,7 @@ std::unique_ptr BootParameters::GenerateFromFile(const std::string& path, const std::optional& savestate_path) { - const bool is_drive = cdio_is_cdrom(path); + const bool is_drive = Common::cdio_is_cdrom(path); // Check if the file exist, we may have gotten it from a --elf command line // that gave an incorrect file name if (!is_drive && !File::Exists(path)) diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp index 5e603610b2..477daafd40 100644 --- a/Source/Core/DiscIO/Blob.cpp +++ b/Source/Core/DiscIO/Blob.cpp @@ -176,7 +176,7 @@ u32 SectorReader::ReadChunk(u8* buffer, u64 chunk_num) std::unique_ptr CreateBlobReader(const std::string& filename) { - if (cdio_is_cdrom(filename)) + if (Common::cdio_is_cdrom(filename)) return DriveReader::Create(filename); File::IOFile file(filename, "rb"); diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp index 178beb12d6..96cc4d8f6f 100644 --- a/Source/Core/DolphinQt2/MenuBar.cpp +++ b/Source/Core/DolphinQt2/MenuBar.cpp @@ -166,7 +166,7 @@ void MenuBar::AddDVDBackupMenu(QMenu* file_menu) { m_backup_menu = file_menu->addMenu(tr("&Boot from DVD Backup")); - const std::vector drives = cdio_get_devices(); + const std::vector drives = Common::cdio_get_devices(); // Windows Limitation of 24 character drives for (size_t i = 0; i < drives.size() && i < 24; i++) { diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index fcf0aa3d0f..89d6fc2302 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -397,7 +397,7 @@ void GameListCtrl::RefreshList() if (SConfig::GetInstance().m_ListDrives) { std::unique_lock lk(m_title_database_mutex); - for (const auto& drive : cdio_get_devices()) + for (const auto& drive : Common::cdio_get_devices()) { auto file = std::make_shared(drive); if (file->IsValid()) diff --git a/Source/Core/DolphinWX/MainMenuBar.cpp b/Source/Core/DolphinWX/MainMenuBar.cpp index 01d3ac2ad7..d58a2d7cf6 100644 --- a/Source/Core/DolphinWX/MainMenuBar.cpp +++ b/Source/Core/DolphinWX/MainMenuBar.cpp @@ -72,7 +72,7 @@ wxMenu* MainMenuBar::CreateFileMenu() const { auto* const external_drive_menu = new wxMenu; - const std::vector drives = cdio_get_devices(); + const std::vector drives = Common::cdio_get_devices(); // Windows Limitation of 24 character drives for (size_t i = 0; i < drives.size() && i < 24; i++) {