diff --git a/compiler/fppu.pas b/compiler/fppu.pas index 309c54b0f6..2301e3ec33 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -267,16 +267,16 @@ uses do_compile:=true; recompile_reason:=rr_noppu; {Check for .pp file} - Found:=UnitExists(target_info.sourceext,hs); + Found:=UnitExists(sourceext,hs); if not Found then begin { Check for .pas } - Found:=UnitExists(target_info.pasext,hs); + Found:=UnitExists(pasext,hs); end; if not Found and (m_mac in aktmodeswitches) then begin { Check for .p, if mode is macpas} - Found:=UnitExists('.p',hs); + Found:=UnitExists(pext,hs); end; stringdispose(mainsource); if Found then @@ -348,17 +348,17 @@ uses begin { the full filename is specified so we can't use here the searchpath (PFV) } - Message1(unit_t_unitsearch,AddExtension(sourcefn^,target_info.sourceext)); - fnd:=FindFile(AddExtension(sourcefn^,target_info.sourceext),'',hs); + Message1(unit_t_unitsearch,AddExtension(sourcefn^,sourceext)); + fnd:=FindFile(AddExtension(sourcefn^,sourceext),'',hs); if not fnd then begin - Message1(unit_t_unitsearch,AddExtension(sourcefn^,target_info.pasext)); - fnd:=FindFile(AddExtension(sourcefn^,target_info.pasext),'',hs); + Message1(unit_t_unitsearch,AddExtension(sourcefn^,pasext)); + fnd:=FindFile(AddExtension(sourcefn^,pasext),'',hs); end; - if not fnd and (m_mac in aktmodeswitches) then + if not fnd and ((m_mac in aktmodeswitches) or target_info.p_ext_support) then begin - Message1(unit_t_unitsearch,AddExtension(sourcefn^,'.p')); - fnd:=FindFile(AddExtension(sourcefn^,'.p'),'',hs); + Message1(unit_t_unitsearch,AddExtension(sourcefn^,pext)); + fnd:=FindFile(AddExtension(sourcefn^,pext),'',hs); end; if fnd then begin @@ -1611,7 +1611,11 @@ uses end. { $Log$ - Revision 1.67 2005-02-14 17:13:06 peter + Revision 1.68 2005-03-20 22:36:45 olle + * Cleaned up handling of source file extension. + + Added support for .p extension for macos and darwin + + Revision 1.67 2005/02/14 17:13:06 peter * truncate log Revision 1.66 2005/01/19 22:19:41 peter diff --git a/compiler/globals.pas b/compiler/globals.pas index 38e247faf2..b1360298b6 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -76,6 +76,11 @@ interface { maximum nesting of routines } maxnesting = 32; + { Filenames and extensions } + sourceext = '.pp'; + pasext = '.pas'; + pext = '.p'; + treelogfilename = 'tree.log'; {$if defined(CPUARM) and defined(FPUFPA)} @@ -2289,7 +2294,11 @@ end; end. { $Log$ - Revision 1.173 2005-03-13 11:27:52 florian + Revision 1.174 2005-03-20 22:36:45 olle + * Cleaned up handling of source file extension. + + Added support for .p extension for macos and darwin + + Revision 1.173 2005/03/13 11:27:52 florian + gpc mode uses tp_procvars Revision 1.172 2005/02/14 17:13:06 peter diff --git a/compiler/options.pas b/compiler/options.pas index 588b88b886..8a47b61c64 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -1959,12 +1959,13 @@ begin {$ENDIF USE_SYSUTILS} if inputextension='' then begin - if FileExists(inputdir+inputfile+target_info.sourceext) then - inputextension:=target_info.sourceext - else if FileExists(inputdir+inputfile+target_info.pasext) then - inputextension:=target_info.pasext - else if (m_mac in aktmodeswitches) and FileExists(inputdir+inputfile+'.p') then - inputextension:='.p'; + if FileExists(inputdir+inputfile+sourceext) then + inputextension:=sourceext + else if FileExists(inputdir+inputfile+pasext) then + inputextension:=pasext + else if ((m_mac in aktmodeswitches) or target_info.p_ext_support) + and FileExists(inputdir+inputfile+pext) then + inputextension:=pext; end; { Check output dir } @@ -2103,7 +2104,11 @@ finalization end. { $Log$ - Revision 1.170 2005-03-05 16:37:42 florian + Revision 1.171 2005-03-20 22:36:45 olle + * Cleaned up handling of source file extension. + + Added support for .p extension for macos and darwin + + Revision 1.170 2005/03/05 16:37:42 florian * fixed copy(dyn. array,...); Revision 1.169 2005/03/04 16:49:22 peter diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 84f84c5711..84fc02708e 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -1132,9 +1132,9 @@ implementation if (not found) then found:=findincludefile(path,name,'.inc',foundfile); if (not found) then - found:=findincludefile(path,name,target_info.sourceext,foundfile); + found:=findincludefile(path,name,sourceext,foundfile); if (not found) then - found:=findincludefile(path,name,target_info.pasext,foundfile); + found:=findincludefile(path,name,pasext,foundfile); end; if current_scanner.inputfilecount