May 17, 2004
As i mentioned before i'm trying to make a stub for Carbon on MacOS X.  Well I ran Carbon.h through the gcc's preprocessor and it came out at 80,000 lines.   Is there some way I can more easily do this?
I'm essentially going through it by hand, and i'm not even 1000 lines through it.  I noticed some windows stuff APIs got ported really quickly.  I can't imagine they were any smaller.

Any ideas to speed this up would be great.

May 17, 2004
Lws wrote:
> As i mentioned before i'm trying to make a stub for Carbon on MacOS X.  Well I ran Carbon.h through the gcc's preprocessor and it came out at 80,000 lines.   Is there some way I can more easily do this?
> I'm essentially going through it by hand, and i'm not even 1000 lines through it.  I noticed some windows stuff APIs got ported really quickly.  I can't imagine they were any smaller.
> 
> Any ideas to speed this up would be great.

This is similar to a question posed yesterday at dsource.org.
http://www.dsource.org/forums/viewtopic.php?t=139

I'll basically tell you what I told Xerpher:

Andy's webpage (http://andy.tadan.us/d/) has an item called SWIG on it:

"SWIG (with a D mode)
This is a very early test to see how well SWIG could be used to generate D interfaces from existing C and C++ libraries. The outlook is anything but grim. (Last updated 21 Sep 2003)"

Also, Y. Tomino (http://hp.vector.co.jp/authors/VA028375/d/windows.h.html) has a Perl script that he uses for converting Windows headers.

These projects may be of use to you.

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
June 02, 2004

J C Calvarese wrote:

> Lws wrote:
> > As i mentioned before i'm trying to make a stub for Carbon on MacOS X.
> > Well I ran Carbon.h through the gcc's preprocessor and it came out at
> > 80,000 lines.   Is there some way I can more easily do this?
> > I'm essentially going through it by hand, and i'm not even 1000 lines
> > through it.  I noticed some windows stuff APIs got ported really
> > quickly.  I can't imagine they were any smaller.
> >
> > Any ideas to speed this up would be great.
>
> This is similar to a question posed yesterday at dsource.org. http://www.dsource.org/forums/viewtopic.php?t=139
>
> I'll basically tell you what I told Xerpher:
>
> Andy's webpage (http://andy.tadan.us/d/) has an item called SWIG on it:
>
> "SWIG (with a D mode)
> This is a very early test to see how well SWIG could be used to generate
> D interfaces from existing C and C++ libraries. The outlook is anything
> but grim. (Last updated 21 Sep 2003)"

> --
> Justin (a/k/a jcc7)
> http://jcc_7.tripod.com/d/

Thank you for this reference to SWIG for D.  I have used SWIG in the past for interfacing to Ruby and Tcl.  I have now tried this one out on both Linux (Fedora Core 1) and Windows and have some tests working.

John Fletcher


Top | Discussion index | About this forum | D home