[fpc-devel] Dynamically Loading Libraries

Vincent Snijders vsnijders at vodafonevast.nl
Mon Nov 2 14:19:43 CET 2009


Ivo Steinmann schreef:
> Hello all
> 
> I started some wiki for dynamic loading libraries support discussion.
> 
> http://wiki.freepascal.org/Dynamically_loading_headers
> 
> I already added an experimental implementation. If you have got some
> ideas, whises and criticism, don't hesitate to write.
> 

I don't like the looks of lines like:
{$IFDEF S}function{$ELSE}var{$ENDIF}foobar_dosomething{$IFDEF D}: 
function{$ENDIF}(a:cint; b:cdouble): cint; extdecl;{$IFDEF S}external 
foobarlib;{$ENDIF}

They are hard to read. I understand that this way makes sure that both 
static and dynamical declaration are in sync, but the loss of 
readability is too much.

Maybe it is better to generate a foobar_dyn.inc based on the foobar.inc 
or generate both foobar.inc and foobar_dyn.inc from a common file format 
(maybe even the original header file).

Vincent



More information about the fpc-devel mailing list