View Issue Details

IDProjectCategoryView StatusLast Update
0006159JEDI VCL00 JVCL Componentspublic2015-09-14 13:20
ReporterAriochAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.48 
Summary0006159: Two functions to be removed for XE2+ from JvJCLUtils
Descriptionfunction InvalidateRect(hWnd: HWND; const lpRect: TRect; bErase: BOOL): BOOL;
begin
  Result := Windows.InvalidateRect(hWnd, @lpRect, bErase);
end;

function InvalidateRect(hWnd: HWND; lpRect: PRect; bErase: BOOL): BOOL;
begin
  Result := Windows.InvalidateRect(hWnd, lpRect, bErase);
end;

--------

They are already in Windows.pas and due to this programs do not compile, instead throwing "ambiguous overloaded call" error

--------

Also they should be marked "inline"
TagsNo tags attached.

Activities

Arioch

2013-07-04 18:59

developer   ~0020554

http://stackoverflow.com/questions/17474753/

These declarations are to be removed for Delphi 2009+

2013-07-05 12:59

 

0006159_JvJCLUtils.pas.patch (1,011 bytes)
Index: JvJCLUtils.pas
===================================================================
--- JvJCLUtils.pas	(revision 13494)
+++ JvJCLUtils.pas	(working copy)
@@ -471,8 +471,11 @@
 
 function CreateScreenCompatibleDC: HDC;
 
+{$IfNDef RTL200_UP}
+// Else overloads  are already in Windows.pas and this declaration may provoke "ambiguos call" error
 function InvalidateRect(hWnd: HWND; const lpRect: TRect; bErase: BOOL): BOOL; overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
 function InvalidateRect(hWnd: HWND; lpRect: PRect; bErase: BOOL): BOOL; overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
+{$EndIf}
 
 { begin JvRLE }
 
@@ -4060,6 +4063,7 @@
   Result := CreateCompatibleDC(HDC_DESKTOP);
 end;
 
+{$IfNDef RTL200_UP}
 function InvalidateRect(hWnd: HWND; const lpRect: TRect; bErase: BOOL): BOOL;
 begin
   Result := Windows.InvalidateRect(hWnd, @lpRect, bErase);
@@ -4069,6 +4073,7 @@
 begin
   Result := Windows.InvalidateRect(hWnd, lpRect, bErase);
 end;
+{$EndIf}
 
 { begin JvRLE }
 

AHUser

2013-07-05 23:22

developer   ~0020557

Fixed in master branch.

Arioch

2013-08-20 17:16

developer   ~0020585

I used {$IfNDef RTL200_UP}

You committed {$IFNDEF COMPILER12_UP}

I wonder which is better.
Actually the error is generated by RTL, not the compiler.

If we consider RTL to be uniquely identified by compiler, then RTL_xxxx symbols in jedi.inc seem to be redundant and only waste attention span and name space.

However if we'd think they matter - for code self-documenting if nothing else - then it looks RTL200_UP symbol is more proper choice.

AHUser

2013-08-20 22:18

developer   ~0020586

The JCL mainly uses the RTLxxx defines whereas the JVCL uses the COMPILERxx defines.

Arioch

2013-08-23 10:02

developer   ~0020594

I thin that could be documented, or unified between these tightly coupled projects

Issue History

Date Modified Username Field Change
2013-07-04 17:43 Arioch New Issue
2013-07-04 18:59 Arioch Note Added: 0020554
2013-07-05 12:59 Arioch File Added: 0006159_JvJCLUtils.pas.patch
2013-07-05 23:22 AHUser Note Added: 0020557
2013-07-05 23:22 AHUser Status new => resolved
2013-07-05 23:22 AHUser Fixed in Version => Daily / SVN
2013-07-05 23:22 AHUser Resolution open => fixed
2013-07-05 23:22 AHUser Assigned To => AHUser
2013-08-20 17:16 Arioch Note Added: 0020585
2013-08-20 17:16 Arioch Status resolved => feedback
2013-08-20 17:16 Arioch Resolution fixed => reopened
2013-08-20 22:18 AHUser Note Added: 0020586
2013-08-23 10:02 Arioch Note Added: 0020594
2013-08-23 10:02 Arioch Status feedback => closed
2013-08-23 10:02 Arioch Resolution reopened => fixed
2015-09-14 13:20 obones Fixed in Version Daily / GIT => 3.48