mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +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
|
||||
ConvertSettingsForm: TConvertSettingsForm;
|
||||
|
||||
function IsWinSpecificUnit(const ALowercaseUnitName: string): Boolean;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
@ -333,6 +336,16 @@ begin
|
||||
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 }
|
||||
|
||||
constructor TConvertSettings.Create(const ATitle: string);
|
||||
|
@ -238,15 +238,16 @@ begin
|
||||
IDEMessagesWindow.AddMsg(Format(lisConvDelphiFixedUnitCase,
|
||||
[OldUnitName, NewUnitName]), '', -1);
|
||||
end;
|
||||
// Report Windows specific units as missing if target is MultiPlatform,
|
||||
// needed if work-platform is Windows (kind of a hack). 'variants' ?
|
||||
if Settings.MultiPlatform and ((LowNU='windows') or (LowNU='shellapi')) then
|
||||
// Report Windows specific units as missing if target is MultiPlatform.
|
||||
// Needed if work-platform is Windows (kind of a hack).
|
||||
if Settings.MultiPlatform and IsWinSpecificUnit(LowNU) then
|
||||
fMissingUnits.Add(s);
|
||||
end
|
||||
else begin
|
||||
// Omit Windows specific units from the list if target is "Windows only",
|
||||
// needed if work-platform is different from Windows (kind of a hack).
|
||||
if Settings.MultiPlatform or ((LowNU<>'windows') and (LowNU<>'shellapi')) then
|
||||
// If the unit is not found, add it to fMissingUnits, but don't add
|
||||
// Windows specific units if target is "Windows only".
|
||||
// Needed if work-platform is different from Windows (kind of a hack).
|
||||
if Settings.MultiPlatform or not IsWinSpecificUnit(LowNU) then
|
||||
fMissingUnits.Add(s);
|
||||
end;
|
||||
if CodeTool.CurPos.Flag=cafComma then begin
|
||||
|
Loading…
Reference in New Issue
Block a user