[fpc-devel] New rules for External

Peter Vreman peter at freepascal.org
Fri Nov 26 16:04:11 CET 2004


> This is not Delphi compatible ...

Ofcourse we check this before changing things like this. Delphi only
accepts the next directive for importing from DLLs:

external 'dllname' name 'functionname'


FPC supports besides importing from DLLs also referencing other public
accessible assembler symbols. These can come from sharedlibraries or from
linked objects or even from routines in pascal that are declared public.

external name 'functionname'
external 'dllname'

If no functionname is specified the following rules are used:
- default is to use the name as written in the source
- for cdecl declared procedures the name as written in the source
prepended with _ (for most targets, some don't need the _ prefix)


For referencing functions with external in your own program or exporting
for referencing from other languages like C:

public
public name 'functionname'

For the functionname the same rules as with external apply (as written in
source and for cdecl prepended with a _)







More information about the fpc-devel mailing list