Parsing Error from gnugettext unit
Brought to you by:
gveith
Hi,
i tried to parse a project with gnugettext unit inside.
I have a parsing error message. here is the etract of the
source code :
------------- CODE_START -------------------
{$ifndef DELPHI5OROLDER}
function TGnuGettextInstance.dngettext(const
szDomain: string; singular,
plural: ansistring; Number: Integer): widestring;
begin
Result:=dngettext (szDomain, ansi2wide(singular),
ansi2wide(plural), Number);
end;
{$endif}
------------- CODE_END -------------------
So, I haven't found any options to say that
this 'DELPHI5OROLDER' is undefined. I'm surprise, since it
works with other parsers.
Find attached the error screenshot (gnugettext.png)
Hope it will help you.
TridenT
Logged In: YES
user_id=1075015
DELPHI5OROLDER is defined at the beginning of the file
depending on the Delphi-Version you are using, or in this
case, depending on the version of Delphi you set DelphiDoc
to "emulate". If you want to undefine it, i.e. let it not be
defined, set it to Delphi 6+ (on the first tab, either
directly in the RadioGroup "Delphi Version" or use the
button "Compiler Options").
But the error you see happens on another account. The
forward-declaration of the method is declared with
"Number:longint", but the actual implementation is declared
with "Number: Integer" and these two types needn't necessary
to be the same one. So DelphiDoc is complaining about not
finding a forward-declaration with the exact same
parameters. You'll have either to parse it with the version
of Delphi 5 or edit one of the types to match the other one.
A total of four "Integer"s have to be changed to "LongInt"s.
This one is the real error.
Btw., also DelphiDoc isn't .NET-compliant (I don't really
know, what changes on behalf of the Delphi language), so if
you got a version of gnugettext.pas where in the uses-clause
"System.Globalization" is used, you will get an error at the
separating dot "." (and I think, the file may be wrong there
anyway, original Delphi 5 (and 6?) should also generate an
error message there).