win32: fix opening CD drive on command line. libretro build fix
This commit is contained in:
parent
9ea0563a7a
commit
27a0497dd5
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue