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

View File

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

View File

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