* for FPC 3.2.3 and newer alias GraphType.TGraphicsColor to System.UITypes.TColor, Graphics.PColor to System.UITypes.PColor and LCLType.COLORREF to System.UITypes.TColorRef to avoid type conflicts when both System.UITypes and the LCL units are used

Merge request freepascal.org/lazarus/lazarus!46 with minor change (enabled aliasing for FPC 3.2.3 too).
This commit is contained in:
Sven Barth 2021-11-08 23:05:35 +01:00 committed by Maxim Ganetsky
parent f49b54bae5
commit 53fe133e43
3 changed files with 24 additions and 3 deletions

View File

@ -22,8 +22,15 @@ unit GraphType;
interface
{$if FPC_FULLVERSION>=30203}
{$define UseSystemUITypes}
{$endif}
uses
Classes, SysUtils, Types, Math,
{$ifdef UseSystemUITypes}
System.UITypes,
{$endif}
// LazUtils
FPCAdds, LazLoggerBase;
@ -32,7 +39,7 @@ uses
{$endif}
type
TGraphicsColor = -$7FFFFFFF-1..$7FFFFFFF;
TGraphicsColor = {$ifdef UseSystemUITypes}System.UITypes.TColor{$else}-$7FFFFFFF-1..$7FFFFFFF{$endif};
TGraphicsFillStyle =
(
fsSurface, // fill till the color (it fills all except this color)

View File

@ -37,6 +37,10 @@ interface
{$DEFINE HasFPJoinStyle}
{$ENDIF}
{$IF FPC_FULLVERSION>=30203}
{$DEFINE UseSystemUITypes}
{$ENDIF}
uses
// RTL + FCL
SysUtils, Math, Types, Classes, Contnrs, Laz_AVL_Tree,
@ -55,6 +59,9 @@ uses
{$IFNDEF DisableLCLGIF}
FPReadGif,
{$ENDIF}
{$IFDEF UseSystemUITypes}
System.UITypes,
{$ENDIF}
// LCL
LCLVersion, LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache,
IntfGraphics, IcnsTypes, WSReferences,
@ -62,7 +69,7 @@ uses
GraphType, GraphMath, FPCAdds, LazLoggerBase, LazTracer, LazUtilities;
type
PColor = ^TColor;
PColor = {$IFDEF UseSystemUITypes}System.UITypes.PColor{$ELSE}^TColor{$ENDIF};
TColor = TGraphicsColor;
TFontPitch = (fpDefault, fpVariable, fpFixed);

View File

@ -39,6 +39,10 @@ interface
{$ASSERTIONS ON}
{$endif}
{$if FPC_FULLVERSION >= 30203}
{$define UseSystemUITypes}
{$endif}
uses
{$IFDEF USE_UTF8BIDI_LCL}
UTF8BIDI,
@ -46,6 +50,9 @@ uses
{$ifdef WINDOWS}
windows,
{$endif WINDOWS}
{$ifdef UseSystemUITypes}
System.UITypes,
{$endif}
Classes, SysUtils;
{$ifdef WinCE}
@ -1657,7 +1664,7 @@ const
//==============================================
type
COLORREF = Cardinal;
COLORREF = {$ifdef UseSystemUITypes}System.UITypes.TColorRef{$else}Cardinal{$endif};
TColorRef = COLORREF;
const