[fpc-devel] Packages, Generics

Sven Barth pascaldragon at googlemail.com
Mon Sep 13 14:02:19 CEST 2010

Am 13.09.2010 11:44, schrieb Willibald Krenn:
> But enough about generics, back to packages: I'll start doing an implementation for the non-generic part first. Let's see how this goes. Since I need to read into fpc source (and do this in my spare time), don't expect any spectacular results soon. In case there are more people interested in implementing this, some branch in the repo would be needed - if I am the only one, I will do this locally on my disk.

You might want to start compiler/pmodules.pp. There is already some code 
to parse "package" projects and some code that allows all symbols to be 
exported (this code also appears in ppumove, but only for Linux and DOS).

I've stumpled upon this code last week and tested it on a Linux system. 
Compiling a simple package with a single unit works if I use Win32 as 
target. A .dll (wrong file extension) is generated which exports all 
functions/procedures that are in the interface of my unit or the RTL 
units, but no variables are exported although the Win32 target supports 
this (tested before the package). Using Linux as a target results in an 
internal error and I've not yet found the time to investigate this.

Also "requires" sections aren't parsed yet.

In theory(!) it should be "rather" simple to implement shared cross 
platform packages (those that are loaded on app startup by the OS and 
not dynamically during the run).


More information about the fpc-devel mailing list