On Friday, September 7, 2018 7:12:30 PM MDT solidstate1991 via Digitalmars-d wrote: > While for the most part it still works very well, however when > porting Mago I found a few functions that are not present in C99 > (most notably wcsncpy_s). > > While I can write my own functions to do the same (already done > this with C++'s array since a few classes inherited from > std::vector, hopefully I don't need to fiddle too much with it on > the Debug engine to limit reliance on GC) I think it would be a > good idea to do some updates on the runtime library in this > regard, especially as it's a very easily available @nogc library > too.
If you need a specific C function, it's trivial to create the binding in your own code. So, just because a binding is missing from druntime doesn't mean that you have to write your own solution rather than using the C solution. druntime contains the stdc and OS bindings for convenience and because some of them are necessary for druntime, Phobos, and dmd, but a binding doesn't have to actually be there for you to be able to use a C stdc function. It's just more convenient that way. In any case, if you find that a particular stdc function has no bindings in druntime, feel free to create a PR. The same goes for OS functions (though those are more of a mess - especially on Windows). While occasionally, someone will go to a lot of effort to improve or update some portion of the bindings, for the most part, they only get changed when someone figures out that they need to be updated, or there's a particular binding that they want that isn't there. Those bindings aren't usually very actively maintained in the sense that someone is regularly taking the time to ensure that every binding that should be there is there or that they're all up-to-date. Most of the symbols involved change very rarely, so they don't need to be updated often, but because no one is really focusing on them, pretty much the only way that a new symbol is gets added is because someone wants to use it, figures out that it's missing, and creates a PR for it. - Jonathan M Davis