azonenberg changed the topic of #scopehal to: ngscopeclient, libscopehal, and libscopeprotocols development and testing | https://github.com/ngscopeclient/scopehal-apps | Logs: https://libera.irclog.whitequark.org/scopehal
Degi has quit [Ping timeout: 246 seconds]
Degi has joined #scopehal
Stary has quit [Quit: ZNC - http://znc.in]
Fridtjof has quit [Quit: ZNC - http://znc.in]
Stary has joined #scopehal
Fridtjof has joined #scopehal
balrog has quit [Ping timeout: 255 seconds]
balrog_ has joined #scopehal
bvernoux has joined #scopehal
<d1b2> <fredzo_72653> @azonenberg I get a compilation error with this latest commit : "/ngscopeclient/scopehal-apps/src/ngscopeclient/NFDFileBrowser.cpp:38:10: fatal error: nfd_glfw3.h: No such file or directory" Did I miss something ?
<d1b2> <fredzo_72653> Never mind, it was me not me not updating the submodule... 🤦‍♂️
<d1b2> <fredzo_72653> @azonenberg your latest commit breaks compilation on WIN32: .../NFDFileBrowser.cpp: In member function 'std::optional<std::__cxx11::basic_string<char> > NFDFileBrowser::ThreadProc()': .../NFDFileBrowser.cpp:136:35: error: cannot convert 'nfdfilteritem_t' {aka 'nfdu8filteritem_t'} to 'const nfdnfilteritem_t' in assignment 136 | args.filterList = &filterItem; | ^~~~~~~~~~~ |
<d1b2> | | nfdfilteritem_t {aka nfdu8filteritem_t} .../NFDFileBrowser.cpp:141:47: error: cannot convert 'nfdchar_t' {aka 'char'} to 'nfdnchar_t' {aka 'wchar_t'} 141 | result = NFD_SaveDialogN_With(&outPath, &args); | ^~~~~~~~ | | |
<d1b2> nfdchar_t {aka char} In file included from .../NFDFileBrowser.h:39, from .../NFDFileBrowser.cpp:36: ngscopeclient/scopehal-apps/src/nativefiledialog-extended/src/include/nfd.h:335:58: note: initializing argument 1 of 'nfdresult_t NFD_SaveDialogN_With(nfdnchar_t**, const nfdsavedialognargs_t)' 335 | NFD_INLINE nfdresult_t NFD_SaveDialogN_With(nfdnchar_t** outPath, |
<d1b2> ~~~~~~~~~~~^~~ .../NFDFileBrowser.cpp:147:35: error: cannot convert 'nfdfilteritem_t' {aka 'nfdu8filteritem_t'} to 'const nfdnfilteritem_t*' in assignment 147 | args.filterList = &filterItem; | ^~~~~~~~~ | | | nfdfilteritem_t* {aka nfdu8filteritem_t*}
<d1b2> <fredzo_72653> AFAIU the cross-platform compatible way to do this is to use the U8 alternative of NFDe. See (https://github.com/btzy/nativefiledialog-extended): "The U8/u8 in NFDe refer to the API for UTF-8 characters (char), which most consumers probably want. An N/n version is also available, which uses the native character type (wchar_t on Windows and char on other platforms)."
<d1b2> <fredzo_72653> I fixed it that way : optional<string> NFDFileBrowser::ThreadProc() { if(NFD_Init() != NFD_OKAY) { LogError("NFD_Init() failed\n"); return {}; } nfdchar_t* outPath; nfdu8filteritem_t filterItem = { m_filterName.c_str(), m_filterMask.c_str() }; nfdresult_t result; if(m_saveDialog) { //Fill out arguments nfdsavedialogu8args_t args; args.filterList = &filterItem;
<d1b2> args.filterCount = 1; args.defaultPath = nullptr; NFD_GetNativeWindowFromGLFWWindow(m_parent->GetWindow(), &args.parentWindow); result = NFD_SaveDialogU8_With(&outPath, &args); } else { //Fill out arguments nfdopendialogu8args_t args; args.filterList = &filterItem; args.filterCount = 1; args.defaultPath = nullptr;
<d1b2> NFD_GetNativeWindowFromGLFWWindow(m_parent->GetWindow(), &args.parentWindow); //And run the dialog result = NFD_OpenDialogU8_With(&outPath, &args); } if(result == NFD_OKAY) { string ret = outPath; NFD_FreePath(outPath); NFD_Quit(); return ret; } else { NFD_Quit(); return {}; } }
<d1b2> <azonenberg> Interesting, oops. Please send a PR to fix?
<d1b2> <azonenberg> we should be using UTF-8 for paths
<d1b2> <azonenberg> i guess i misunderstood the changes in the new NFD version
<d1b2> <azonenberg> I actually thought the opposite was the caase
<d1b2> <azonenberg> i read u8 as "unsigned 8" and thought it was for platforms using unsigned chars by default lol
<_whitenotifier-1> [scopehal-apps] fredzo opened pull request #750: Fixed WIN32 compilation. - https://github.com/ngscopeclient/scopehal-apps/pull/750
balrog_ has quit [Quit: Bye]
balrog has joined #scopehal
bvernoux has quit [Quit: Leaving]