diff --git a/CMakeLists.txt b/CMakeLists.txt index e41bba96b..0edf3531c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -680,7 +680,7 @@ if(USE_LIBCDIO) target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LIBCDIO) if(MINGW) # Force static link - target_link_libraries(${PROJECT_NAME} PRIVATE "-l:libcdio.a -l:libiconv.a") + target_link_libraries(${PROJECT_NAME} PRIVATE "-l:libcdio.a -l:libiconv.a -lwinmm") else() target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::CDIO) endif() diff --git a/core/deps/libretro-common/compat/fopen_utf8.c b/core/deps/libretro-common/compat/fopen_utf8.c index 52b481e7e..d3d467798 100644 --- a/core/deps/libretro-common/compat/fopen_utf8.c +++ b/core/deps/libretro-common/compat/fopen_utf8.c @@ -31,7 +31,7 @@ #endif #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(USE_LIBCDIO) // libcdio has its equivalent version #undef fopen void *fopen_utf8(const char * filename, const char * mode) diff --git a/core/imgread/cdio.cpp b/core/imgread/cdio.cpp index 4d4f71b4b..8b328c11e 100755 --- a/core/imgread/cdio.cpp +++ b/core/imgread/cdio.cpp @@ -89,14 +89,21 @@ struct CdioDrive : public Disc if (!devices.empty()) { // If the list isn't empty, check that an entry exists for the current path + std::string lpath(path); +#ifdef _WIN32 + if (lpath.substr(0, 4) != "\\\\.\\") + lpath = "\\\\.\\" + lpath; +#endif bool found = false; for (const std::string& dev : devices) - if (dev == path) { + if (dev == lpath) { found = true; break; } - if (!found) + if (!found) { + WARN_LOG(GDROM, "%s isn't a CD device", path); return false; + } } pCdio = cdio_open(path, DRIVER_DEVICE); if (pCdio == nullptr) {