View previous topic :: View next topic |
Author |
Message |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Tue Oct 26, 2004 3:19 pm Post subject: C bindings |
|
|
I'm currently creating bindings for C99. My hope is that they can eventually replace what's in std.c. I'll post a link once I've got a few more headers finished.
(oh, I'm posting this because I need more eyes than just my own to make sure this will all work on windows/linux--it's pretty much a straight implementation plus bits pulled from the DM headers when necessary). |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Tue Oct 26, 2004 7:43 pm Post subject: |
|
|
Great! I'll keep my eyes on it then. ![Smile](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Tue Oct 26, 2004 8:30 pm Post subject: |
|
|
Here's the first cut:
http://home.f4.ca/sean/d/stdc.zip
It has most of the applicable headers in it. stdio needs a look as a bunch of stuff in there is implementation defined. I'd like to keep the standard C headers pretty much restricted to what's in the C99 spec, and am planning on doing some the Windows-specific ones next. Maybe someone else can tacke the linux/unix ones ![Smile](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Tue Oct 26, 2004 8:45 pm Post subject: |
|
|
Does dmc (digitalmars compiler) meet the C99 spec? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Tue Oct 26, 2004 9:21 pm Post subject: |
|
|
I think it's pretty close, though I haven't done a 1-1 comparison between the spec and the DM headers. I'll try and check into which library functions have been added since the previous C spec and look for them in the DM headers. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Wed Oct 27, 2004 8:58 am Post subject: |
|
|
Okay it looks like DMC has most of the new C99 functions either standard or as underscore-prefixed extensions. I still have to go through math.h and check that, plus I'm going to do as much of tgmath.h as I can although DMC doesn't have this header (it's just type-generic functionf of stuff that's usually already in math.h, so it should be simple enough to do via overloads). I'm also going to do fenv.h and any other remaining headers that might be useful in D. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Wed Oct 27, 2004 12:16 pm Post subject: |
|
|
Second version is up. The file that needs the most attention is stdio.d, I think the others all look pretty good. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Wed Oct 27, 2004 6:18 pm Post subject: |
|
|
Okay final update. I think the headers are complete. They still assume a DigitalMars front-end but should work with a Win32 or Linux back-end. I've preserved copyrights in files where I borrowed stuff from DM or DMD. I'm going to write some unit tests but everything looks good so far. There are some headers I've ignored because they simply don't make sense in D (limits.h, iso646.h, etc). The new C99 stuff is mostly wide i/o or fancy math stuff, both of which DM is quite good at, so on Win32 there should be full support for the new stuff. I haven't tested any of this on Linux, but nothing should be broken that worked before. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Mon Feb 13, 2006 5:52 pm Post subject: |
|
|
I haven't been keeping the zipfile up to date so please check the Ares tree for the latest C99 bindings. If anyone wants me to maintain these headers separately, let me know and I'll see about refreshing the standalone. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|