Conversation
b6c373c to
40a4368
Compare
| static FILE *std_open(const char *path, bool readonly) { | ||
| #if MG_ARCH == MG_ARCH_WIN32 |
There was a problem hiding this comment.
We've already had issues with sockets, we had to define MG_SOCKET_TYPE to support different types returned by different stacks.
I think we should stick to what is already working and building everywhere, or use MG_FILE_TYPE instead.
There was a problem hiding this comment.
Hmm could you elaborate please? FS abstraction seem unrelated to sockets.
There was a problem hiding this comment.
Yes, I'm trying to point out the fact that every implementation may have its own internal type.
We deal with different socket implementations and needed to define our own type to accommodate to differences among those implementations.
The same is bound to happen with different filesystem implementations, and the current type usage hasn't had that problem so far, so I wouldn't risk introducing that issue, so I vote for keeping function signatures and argument types as they are now. Otherwise, go for a definable type like MG_FILE_TYPE, that can be defined at the arch level to the one that particular file system implementation uses.
9b10dad to
68927e9
Compare
This PR depends on #3477
No open/close anymore. Reads and writes are stateless