[M3devel] "target specific pragmas"?

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Thu Feb 14 19:08:35 CET 2008


On Wed, Feb 13, 2008 at 04:28:41AM +0000, Jay wrote:

> But wrapping everything in Modula-3 is so tedious...
> Oh for all languages to just understand C headers so we can stop rewriting them...
> Or some other language, ok...not going to be solved in this forum.

As usual, the problem has no solutions, and there are programs that 
solve it.

It can't be solved because a lot of C headers -- especially the standard 
ones -- use implementation-dependent, and often undocumented,  code 
behind the scenes.  This makes it essentially impossible to define what 
a "C header" is for purposes of implemetation.

But it has been solved, for many practical purposes, byt a program that 
reads C header files and generates the interface code that's needed by 
other languages to interface with the C code.  I'm not sure of that 
program's name but "swix" comes to mind.  Can anyone confirm that?

The program possiblyknown as swix has to be configured (in a 
configuration file) for the particular target language.  And you'd best 
check the output -- it may not automagically handle *everything* C 
compilers can throw at it.  But it is useful.

-- hendrik




More information about the M3devel mailing list