Comments (3)
Macros seem to be, on hindsight, a bad idea.
On Mac and Linux, change the utf8 macros to function definitions, so that all 3 platforms have both sets of function exports.
I think this is the better thing to do - get rid of the macros, and have all 3 platforms export both sets of functions. It should probably be possible in the Mac and Linux implementations to have some __attribute__((alias("stuff")))
stuff to map both exports to the same function definition, so we don't need extra function wrappers (and the header file shouldn't need to know about this aliasing stuff). Will this work with the binding generators? If they only consume the header file, then I think it should work. This should be fully ABI compatible, and essentially API compatible unless someone uses complicated macro or template magic over the macros in the library.
On Mac and Linux, change utf8 to be the default and native to be the macro.
We can't do this without breaking ABI. NFDe is a package at least on Fedora, which uses it as a dynamic library, so changing the names of exported functions will result in a loader error on the end user's machine. Also, those who build NFDe statically will get link errors. In any case, I don't think continuing to use macros are a good idea, just to save a few bytes in the compiled library.
from nativefiledialog-extended.
I'm running into issues on Mac because of signature differences:
NFD_API void NFD_FreePathN(nfdnchar_t* filePath);
NFD_API void NFD_PathSet_FreePathN(const nfdnchar_t* filePath);
//I used real function definitions on Mac and Windows because alias seems unsupported.
void NFD_PathSet_FreePathN(const nfdnchar_t* filePath) {
NFD_FreePathN(const_cast<nfdnchar_t*>(filePath)); //const_cast doesn't seem to be supported on Mac.
}
https://github.com/AssetRipper/nativefiledialog-extended/actions/runs/7171753252
https://github.com/AssetRipper/nativefiledialog-extended/tree/replace-macros-with-alias
from nativefiledialog-extended.
I figured it out. :)
from nativefiledialog-extended.
Related Issues (20)
- Consider documentation website? HOT 2
- [PR for wiki] Add overview comments & move bindings to readme HOT 1
- Consider comparison of other native file dialog libraries? HOT 2
- WebAssembly (emscripten) support HOT 3
- Setting up Xcode search path for nfd.hpp HOT 5
- Try to use portals, and fall back on GTK HOT 3
- Doxygen HOT 6
- Arm64 Support HOT 10
- CI bug? HOT 2
- I made a C# binding HOT 32
- Don't use nullptr in fileOpenDialog->Show HOT 3
- OpenDialog with portal backend allows folders to be picked HOT 1
- Standalone Library build instructions always build Debug version HOT 1
- How to use NFD_OpenDialog(, , , default_path) HOT 3
- Not able to import file with non-ASCII characters in the path on Windows HOT 3
- PickFolder on Portal backend should support default path too HOT 1
- Show hidden files HOT 1
- How to use NFD on Win64? Dll Error when appl started. HOT 2
- Asynchronous file dialogs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativefiledialog-extended.