mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 05:36:10 +02:00
Converter: Treat also Wintypes and Winproc units as Windows specific when converting for multi-platform. Issue #22677
git-svn-id: trunk@38343 -
This commit is contained in:
parent
1223b09763
commit
11a9424522
@ -168,6 +168,9 @@ type
|
|||||||
var
|
var
|
||||||
ConvertSettingsForm: TConvertSettingsForm;
|
ConvertSettingsForm: TConvertSettingsForm;
|
||||||
|
|
||||||
|
function IsWinSpecificUnit(const ALowercaseUnitName: string): Boolean;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|
||||||
@ -333,6 +336,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function IsWinSpecificUnit(const ALowercaseUnitName: string): Boolean;
|
||||||
|
// These units exist in Windows only.
|
||||||
|
// They must be treated as missing units when converting for multi-platform.
|
||||||
|
begin
|
||||||
|
Result := (ALowercaseUnitName = 'windows')
|
||||||
|
or (ALowercaseUnitName = 'shellapi')
|
||||||
|
or (ALowercaseUnitName = 'wintypes')
|
||||||
|
or (ALowercaseUnitName = 'winproc') ;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TConvertSettings }
|
{ TConvertSettings }
|
||||||
|
|
||||||
constructor TConvertSettings.Create(const ATitle: string);
|
constructor TConvertSettings.Create(const ATitle: string);
|
||||||
|
@ -238,15 +238,16 @@ begin
|
|||||||
IDEMessagesWindow.AddMsg(Format(lisConvDelphiFixedUnitCase,
|
IDEMessagesWindow.AddMsg(Format(lisConvDelphiFixedUnitCase,
|
||||||
[OldUnitName, NewUnitName]), '', -1);
|
[OldUnitName, NewUnitName]), '', -1);
|
||||||
end;
|
end;
|
||||||
// Report Windows specific units as missing if target is MultiPlatform,
|
// Report Windows specific units as missing if target is MultiPlatform.
|
||||||
// needed if work-platform is Windows (kind of a hack). 'variants' ?
|
// Needed if work-platform is Windows (kind of a hack).
|
||||||
if Settings.MultiPlatform and ((LowNU='windows') or (LowNU='shellapi')) then
|
if Settings.MultiPlatform and IsWinSpecificUnit(LowNU) then
|
||||||
fMissingUnits.Add(s);
|
fMissingUnits.Add(s);
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
// Omit Windows specific units from the list if target is "Windows only",
|
// If the unit is not found, add it to fMissingUnits, but don't add
|
||||||
// needed if work-platform is different from Windows (kind of a hack).
|
// Windows specific units if target is "Windows only".
|
||||||
if Settings.MultiPlatform or ((LowNU<>'windows') and (LowNU<>'shellapi')) then
|
// Needed if work-platform is different from Windows (kind of a hack).
|
||||||
|
if Settings.MultiPlatform or not IsWinSpecificUnit(LowNU) then
|
||||||
fMissingUnits.Add(s);
|
fMissingUnits.Add(s);
|
||||||
end;
|
end;
|
||||||
if CodeTool.CurPos.Flag=cafComma then begin
|
if CodeTool.CurPos.Flag=cafComma then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user