dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Calling between C and C# IL code: how?


From: Rhys Weatherley
Subject: Re: [DotGNU]Calling between C and C# IL code: how?
Date: Wed, 16 Apr 2003 08:43:01 +1000
User-agent: KMail/1.4.3

On Monday 14 April 2003 06:23 am, David Jung wrote:
> I would like to call C functions from C# and C# from C.
> I think I can figure out C->C# using __invoke__, but can't figure
> out how to do C#->C.

That's because I haven't figured out how to do it yet. :-)  Suggestions for an 
appropriate syntax are welcome.  I think MS has some kind of C# attribute 
that says "this is in the global scope", but I'm not 100% sure how it works 
in the compiler or linker.

Another way to do C->C# is with the "__module" keyword in C#.  See 
"pnetC/libc/unistd/unistd-glue.cs" for an example.  This allows you to define 
a method in C# that looks like a regular function to C.  Avoids the need for 
the ugly __invoke__ syntax.

> PS: Is anone working on a managed C++ compiler for .GNU? (either
> compatible or incompatible with MS's version - don't care)

No plans as yet.  C++ is very, very, very hard.  If we could find a decent 
open/free cfront tool, we could feed the output of that into the C compiler 
as a stopgap solution.  Porting gcc has always been in the "too hard" basket.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]