For those with old Delphi version, but want new FreePascal 3 code...
Why not mix in a DLL?
I do this for commercial project, it works nice!
Anyhow, I write a program which create headers for you!
Compile with -Sd switch. Code is public domain.
Usage:
header.exe test.ini
Output:
testHeader.pas
unit testHeader;
{$ifDef fpc}{$mode delphiUnicode}{$endIf}
interface
type TEnum=procedure(_1:integer);
procedure Enum(_1:PWideChar;_2:TEnum);
implementation
{$ifDef fpc}
{$i test.inc}
exports Enum;
{$else}
procedure Enum;external 'test.dll';
{$endIf}
end.