[fpc-pascal]Re: Strange Concept

md md at realmwireless.com
Thu Nov 9 19:01:39 CET 2000


Florian and Michael:

Thank you for the answer.

I will handle the stdin/output problem by passing those FILE* into the 
library and assigning them.

The library uses the stack, not the heap.  Except for IPC calls, but
that
should be outside the scope of the heap manager.

It is very productive to be able to write code in pascal and then link
into c programs.  This way
I do not have to re-implement the code in C, thus duplicating my
creation and maintenance of code.

Mark Diener


Michael Van Canneyt wrote:
> 
> On Thu, 9 Nov 2000, md wrote:
> 
> > Free pascal community:
> >
> > Peter Vreman responded that there is a problem getting pascal compiled
> > code to be used by code compiled by GNU C.
> 
> This is correct.
> 
> >
> > Please confirm that any code compiled under pascal is not usable by code
> > in GNU C.
> 
> This is not entirely true.
> 
> >
> > No ability to link object file?   test.o
> 
> Possible.
> 
> > No ability to create shared library?  libtest.so
> 
> Createable, but not always usable.
> it is _NOT_ usable in following circumstances:
>  - Use of the heap in a library.
>    (can be remedied by using the CMem() unit, which uses the C heap manager)
>  - Units with initialization code.
>  - Writing to standard input/output.
> 
> A library that does not use any of the above is possible.
> 
> e.g. someone made a library containing UDF's for the
> Interbase SQL server in a shared library, for string functions.
> it works without problems.
> 
> > No ability to create static library?  libtest.a
> 
> Same applies here.
> 
> The problem is that the unit initialization is not carried out
> by C libraries. We are working on this; a solution is known, but
> must be implemented and tested.
> 
> Michael.
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list