According to Jan-Jaap van der Heijden:
Borland does it like this:
unit Foo;
interface
function Bar(var i: integer): integer;
implementation
function Bar; external;
end.
GPC allows this:
Unit Foo;
Interface
Function Bar ( Var i: Integer ): Integer; external;
Implementation
end.
(Or `attribute', or `asmname' in the Interface part.)
However, Borland-comptaible syntax should be supported, too.
Although it accepts the input, GPC doesn't do anything with the directives. (function attributes not surviving the GPI mechanism is a long-standing bug, but the "asmname" is silently ignored).
It's fixed now. :-)
[...] GPC has no equivalent for the "DLLfile". But, if implemented, the automake mechanism could add an option "-lDLLfile" to the linker command line, something you have to do manually now. This is useful for all platforms, not just windows DLL's BTW.
I agree.
- Are there any reasons not to change the "external" declaration, at least for "borland" mode?
This should be done. With what priority?
- Any objections against allowing (working, that is) function attributes in the implementation part?
When we want them in the GPI file, they *must* be present already in the Interface part.
Greetings,
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970624] - http://home.pages.de/~gnu-pascal/ [970125]