Will the core.stdc module be updated for newer versions of C?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Sep 10 07:43:52 UTC 2018


On Sunday, September 9, 2018 11:37:54 AM MDT Laurent Tréguier via 
Digitalmars-d wrote:
> On Saturday, 8 September 2018 at 01:12:30 UTC, solidstate1991
>
> 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.
>
> I thought the same after having to use Windows-specific functions
> from `core.sys.windows`, some (presumably newer) functions are
> missing from the definitions.
> At that time I thought about trying to get my hands dirty on
> this, but I don't know how much time it would take to do that
> though.

Historically, most of the Win32 API has been missing from druntime, and many
of the symbols were in the wrong place (they should really be in modules
corresponding to the C headers that the symbols come from, but many of them
were just put in core.sys.windows.windows as if everything were in
windows.h). Most folks doing serious stuff with the Win32 API used to use an
external project that had a much more thorough version of the bindings
(though I can't find it at the moment, looking around for D projects with
Win and API in the name, so I don't know what happened to it). However,
looking over what's in druntime for Windows now, it looks like Vladimir
added a ton of bindings back in 2015 (probably from that external project).
So, it would appear that the situation for the Windows bindings in druntime
is _way_ better than it used to be.

Regardless, if you find that a particular binding is missing, feel free to
create a PR for it. Usually, such bindings only get added when someone wants
to use a particular C function and then discovers that the binding is
missing, so they create a PR to add it. It's not like we have a system for
discovering all of the bindings that are supposed to be there, and while
occasionally, someone will make an effort to make the bindings more
comprehensive, it's not something that's regularly worked on.

- Jonathan M Davis






More information about the Digitalmars-d mailing list