On Fri, 2 Feb 2018, Adriaan van Os wrote:

> I have to import the math.h libc functions listed here
> <http://pubs.opengroup.org/onlinepubs/009695399/toc.htm>. What is the
> recommended way to do this for general Linux compatibility ? Simply
> declare them external ? Load them from libc dynamically ? Anything else
> ? I know that the FPC runtime lib itself jumps through some hoops to be
> as independent of libc (or a specific version of libc) as possible.

We actually link against libc and pthreads when multithreading is involved
on Unices. You need to declare all functions cdecl; external;

See the cmem unit in the RTL for example, which provides simple
link-against-C examples for a number of platforms, both dynamic and static
linking case (pick the option which fits best your usecase):


fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org

Reply via email to