On Sun, 13 Oct 2019, Sven Barth via fpc-pascal wrote:
Could the missing ".inc" be the problem? I have not checked, but it
could
be that FPC always adds ".inc" if no extension is present.
Well spotted. I didn't notice that the extension was missing.
That will definitely not be done in fcl-passrc.
To be clear:
here I meant that 'currently that will definitely not be done in fcl-passrc.'
I was not aware FPC does this either. It's not documented, that's for
sure:
https://www.freepascal.org/docs-html/current/prog/progsu40.html
Delphi also does not look for .inc files, I checked. It only adds
extension
.pas
So, conclusion: FPC is way too lenient. ;-)
This is how FPC looks for an include file:
=== code begin ===
{ try to find the file }
found:=findincludefile(path,name,foundfile);
if (not found) and (ExtractFileExt(name)='') then
begin
{ try default extensions .inc , .pp and .pas }
if (not found) then
found:=findincludefile(path,ChangeFileExt(name,'.inc'),foundfile);
if (not found) then
found:=findincludefile(path,ChangeFileExt(name,sourceext),foundfile);
if (not found) then
found:=findincludefile(path,ChangeFileExt(name,pasext),foundfile);
Thanks, I will adapt the mechanism in pas2js.
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal