Discussion:
C external lib
(too old to reply)
m***@gmail.com
2016-01-29 02:34:02 UTC
Permalink
Maybe it is too soon for such a question, but here it goes anyway.
How easy/hard would be to use a C external multiplataform lib like TBOX ( https://github.com/waruqi/tbox ) with M2C for writing Modula-2 code in such a way that I could compile the generated C files in Windows, Linux or OSX ?
I know this is a 2 steps task, first using TBOX from Modula-2 (is it just to write a .def for it ?) and the second is to compile the C files.
Thanks.
trijezdci
2016-03-06 15:41:38 UTC
Permalink
Post by m***@gmail.com
Maybe it is too soon for such a question, but here it goes anyway.
How easy/hard would be to use a C external multiplataform lib like TBOX ( https://github.com/waruqi/tbox ) with M2C for writing Modula-2 code in such a way that I could compile the generated C files in Windows, Linux or OSX ?
I know this is a 2 steps task, first using TBOX from Modula-2 (is it just to write a .def for it ?) and the second is to compile the C files.
Thanks.
If you have a little more patience, with the ongoing M2C rewrite this will be a one-step task very soon.

Supported OSes thus far and porting work in progress:

https://bitbucket.org/trijezdci/m2c-rework/wiki/Porting%20M2C

A description of the FFI pragma to declare a M2 definition module as an interface for a library written in C is at the very bottom of this page:

https://bitbucket.org/trijezdci/m2c-rework/wiki/Language%20Extensions

In the old M2C, mixing M2 with C requires C inline code within your M2 sources.
Loading...