[fpc-devel] the libc unit on 64-bit systems

Marco van de Voort marcov at stack.nl
Thu Jan 31 22:14:51 CET 2008


> I know the 'libc' unit is for linux-x86 only.  Does that also exclude
> 64-bit Linux?

Yes.
 
> If so, how can I IFDEF code that needs to run on Linux (32 & 64 bit)
> and FreeBSD (32 & 64 bit) when 'libc' only works on Linux and 32-bit
> systems.

Something like

{$ifdef cpu386}
{$ifdef linux}
{$define linux386}
{$endif}
{$endif}

>  Clearly this code smells, so I should actually find a
> alternative solution and get rid of libc altogether.

Yes, that's what baseunix and unix are ( and sockets,termio,syscalls etc).

It is not complete by far, but it is getting there. If I can get the "users"
package cleaned up, some more reasons to use unit libc disappear.

This also because mixing units can lead to problems since they are separate
collections of types.




More information about the fpc-devel mailing list