diff --git a/src/app/core/platform/file_dialog.cc b/src/app/core/platform/file_dialog.cc index 61533c15..5e33ad7e 100644 --- a/src/app/core/platform/file_dialog.cc +++ b/src/app/core/platform/file_dialog.cc @@ -219,7 +219,7 @@ std::vector FileDialogWrapper::GetFilesInFolder( #elif defined(__linux__) -#ifdef YAZE_ENABLE_NFD +#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD #include #endif @@ -233,17 +233,17 @@ std::string FileDialogWrapper::ShowOpenFileDialog() { } std::string FileDialogWrapper::ShowOpenFileDialogNFD() { -#ifdef YAZE_ENABLE_NFD +#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD NFD_Init(); nfdu8char_t *out_path = NULL; - nfdu8filter_item_t filters[1] = {{"Rom File", "sfc,smc"}}; + nfdu8filteritem_t filters[1] = {{"Rom File", "sfc,smc"}}; nfdopendialogu8args_t args = {0}; args.filterList = filters; args.filterCount = 1; nfdresult_t result = NFD_OpenDialogU8_With(&out_path, &args); if (result == NFD_OKAY) { std::string file_path_linux(out_path); - NFD_Free(out_path); + NFD_FreePath(out_path); NFD_Quit(); return file_path_linux; } else if (result == NFD_CANCEL) { @@ -274,13 +274,13 @@ std::string FileDialogWrapper::ShowOpenFolderDialog() { } std::string FileDialogWrapper::ShowOpenFolderDialogNFD() { -#ifdef YAZE_ENABLE_NFD +#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD NFD_Init(); nfdu8char_t *out_path = NULL; - nfdresult_t result = NFD_PickFolderU8(&out_path); + nfdresult_t result = NFD_PickFolderU8(&out_path, NULL); if (result == NFD_OKAY) { std::string folder_path_linux(out_path); - NFD_Free(out_path); + NFD_FreePath(out_path); NFD_Quit(); return folder_path_linux; } else if (result == NFD_CANCEL) { diff --git a/src/app/core/platform/file_dialog.mm b/src/app/core/platform/file_dialog.mm index 27a42a22..24b8b10f 100644 --- a/src/app/core/platform/file_dialog.mm +++ b/src/app/core/platform/file_dialog.mm @@ -6,7 +6,7 @@ #include "app/core/features.h" -#ifdef YAZE_ENABLE_NFD +#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD #include #endif @@ -107,7 +107,7 @@ std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialog() { // NFD implementation for macOS (fallback to bespoke if NFD not available) std::string yaze::core::FileDialogWrapper::ShowOpenFileDialogNFD() { -#ifdef YAZE_ENABLE_NFD +#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD NFD_Init(); nfdu8char_t *out_path = NULL; nfdu8filteritem_t filters[1] = {{"Rom File", "sfc,smc"}}; @@ -134,7 +134,7 @@ std::string yaze::core::FileDialogWrapper::ShowOpenFileDialogNFD() { } std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialogNFD() { -#ifdef YAZE_ENABLE_NFD +#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD NFD_Init(); nfdu8char_t *out_path = NULL; nfdresult_t result = NFD_PickFolderU8(&out_path, NULL);