View Issue Details

IDProjectCategoryView StatusLast Update
0029012FPCRTLpublic2015-11-21 20:51
ReporterCyraxAssigned ToMattias Gaertner 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindows OSServer 2008 R2OS Version6.1.7601 (SP1)
Product Version3.1.1Product Buildr32342 
Target VersionFixed in Version3.1.1 
Summary0029012: Can't build Lazarus due to missing tagSIZE type.
DescriptionAlso tagPoint type is missing.

See summary and Additional Information for more info.
Additional InformationLazarus revision 50335
FPC revision 32342
 
FPC make commands:
clean
all
install
COMPILER_OPTIONS=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -Xs- -Si- -vbq -XX- -dTEST_WIN32_SEH -dSYSTEM_DISABLE_INLINE -dTYPINFO_DISABLE_INLINE -dSYSUTILS_DISABLE_INLINE -dSTRINGS_DISABLE_INLINE -dWINDOWS_DISABLE_INLINE -dCTYPES_DISABLE_INLINE -dFPEXTRES_DISABLE_INLINE -dHEAPTRC_DISABLE_INLINE -dMACPAS_DISABLE_INLINE -dFPC_COMPILER_DISABLE_INLINE -dNO_SMART_LINK
INSTALL_PREFIX=F:\free_pascal_and_lazarus\fpc\i386\trunk\binary\fpc_trunk
UPXPROG=echo
IDE=1
REVSTR=32342
ALLOW_WARNINGS=1
NOWPOCYCLE=1
 
Lazarus make commands:
clean
all
OPT=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -gh -O- -Xs- -Si- -vb -XX- -dTEST_WIN32_SEH -dHEAPTRC_WINDOW -dDBG_WITH_DEBUGGER_DEBUG
UPXPROG=echo
USESVN2REVISIONINC=0
TagsNo tags attached.
Fixed in Revision50374(lazarus), 32361 (FPC)
FPCOldBugId
FPCTarget
Attached Files
  • types.pp.patch (413 bytes)
    Index: rtl/objpas/types.pp
    ===================================================================
    --- rtl/objpas/types.pp	(revision 32342)
    +++ rtl/objpas/types.pp	(working copy)
    @@ -80,10 +80,14 @@
     
       TRect  = Windows.TRect;
       PRect  = Windows.PRect;
    +
     {$else}
       {$i typshrdh.inc}
     {$endif}
     
    +  tagSIZE = TSize;
    +  tagPOINT = TPoint;
    +
       { TPointF }
       TPointF =
     {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
    
    types.pp.patch (413 bytes)
  • tagsize_canvas.inc.patch (378 bytes)
    Index: lcl/include/canvas.inc
    ===================================================================
    --- lcl/include/canvas.inc	(revision 50336)
    +++ lcl/include/canvas.inc	(working copy)
    @@ -460,7 +460,7 @@
     
     procedure TCanvas.DoGetTextSize(Text: string; var w, h: integer);
     var
    -  TxtSize: tagSIZE;
    +  TxtSize: TSIZE;
     begin
       TxtSize:=TextExtent(Text);
       w:=TxtSize.cx;
    

Activities

Cyrax

2015-11-16 08:05

reporter   ~0087306

Related to bug report http://bugs.freepascal.org/view.php?id=21041

Cyrax

2015-11-16 08:15

reporter  

types.pp.patch (413 bytes)
Index: rtl/objpas/types.pp
===================================================================
--- rtl/objpas/types.pp	(revision 32342)
+++ rtl/objpas/types.pp	(working copy)
@@ -80,10 +80,14 @@
 
   TRect  = Windows.TRect;
   PRect  = Windows.PRect;
+
 {$else}
   {$i typshrdh.inc}
 {$endif}
 
+  tagSIZE = TSize;
+  tagPOINT = TPoint;
+
   { TPointF }
   TPointF =
 {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
types.pp.patch (413 bytes)

Cyrax

2015-11-16 08:16

reporter   ~0087307

Attached patch which will fix this bug.

Marco van de Voort

2015-11-16 21:22

manager   ~0087332

What is the justification for using tag* rather than TRect/TSize ? Suggest fix on Lazarus side, or explanation.

Cyrax

2015-11-16 21:40

reporter   ~0087335

Maybe Delphi compatibility?

Do-wan Kim

2015-11-17 00:38

reporter  

tagsize_canvas.inc.patch (378 bytes)
Index: lcl/include/canvas.inc
===================================================================
--- lcl/include/canvas.inc	(revision 50336)
+++ lcl/include/canvas.inc	(working copy)
@@ -460,7 +460,7 @@
 
 procedure TCanvas.DoGetTextSize(Text: string; var w, h: integer);
 var
-  TxtSize: tagSIZE;
+  TxtSize: TSIZE;
 begin
   TxtSize:=TextExtent(Text);
   w:=TxtSize.cx;

lks

2015-11-17 00:55

reporter   ~0087346

I fixed it on the lazarus side by replacing tagSize with TSize in canvas.inc, although I haven't gotten around to filing a Lazarus report:

Index: lcl/include/canvas.inc
===================================================================
--- lcl/include/canvas.inc (revision 50338)
+++ lcl/include/canvas.inc (working copy)
@@ -460,7 +460,7 @@
 
 procedure TCanvas.DoGetTextSize(Text: string; var w, h: integer);
 var
- TxtSize: tagSIZE;
+ TxtSize: TSize;
 begin
   TxtSize:=TextExtent(Text);
   w:=TxtSize.cx;
striker:lazarus lou$

Bart Broersma

2015-11-17 18:38

reporter   ~0087363

It's a regression from 3.0.0/2.6.4
D7 defines tagSize and tagPoint in unit types, so it's a compatibility issue as well.

Marius Maximus

2015-11-17 19:26

reporter   ~0087366

I have this same error
Lazarus revision 50371
FPC revision 32353

Mattias Gaertner

2015-11-17 22:46

manager   ~0087370

I changed it to TSize in lcl/include/canvas.inc

Marco van de Voort

2015-11-18 08:48

manager   ~0087374

Last edited: 2015-11-18 08:48

View 2 revisions

If Delphi defines it, I'll add an alias to types, but I consider that legacy/cruft in Delphi, so I'll add them deprecated.\

"tag" is a prefix used in Windows headers for the structure without struct, while the name is reserved including the struct. (typedef struct tagx {fields..} x )

I've no idea what it is good for in current C, since the tag part can be omitted nowadays. Maybe for the benefit of old compilers.

Bart Broersma

2015-11-18 12:33

reporter   ~0087378

Last edited: 2015-11-18 12:34

View 2 revisions

@Iks/Cyrax: can one of you open a new ticket in Lazarus, stating that tagXXX is now deprecated, so we can change it to TSize/TWhatEver?
You can assign it to me (if you have the proper rights in Mantis).

lks

2015-11-19 02:01

reporter   ~0087393

Wasn't this already changed in Rev 50374 of lazarus?

Rik van Kekem

2015-11-19 10:06

reporter   ~0087397

Yes, this was fixed in Lazarus r50374. Mattias forgot to mark it as fixed here.

Mattias Gaertner

2015-11-19 10:29

manager   ~0087399

If you want to restore tagSize in FPC sources, please create another bug report.

Cyrax

2015-11-19 11:43

reporter   ~0087400

@Mattias Gaertner
Isn't this bug report still suitable for that suggestion? It is in FPC side of bugtracker.

Mattias Gaertner

2015-11-19 11:55

manager   ~0087401

Yes, it is in the FPC side, but the bug is clearly about "Can't build Lazarus", not about "need tagSize for Delphi compatibility".

Marco van de Voort

2015-11-19 12:54

manager   ~0087402

I added tagpoint and tagsize, but deprecated as detailed in early remark.

Issue History

Date Modified Username Field Change
2015-11-16 08:05 Cyrax New Issue
2015-11-16 08:05 Cyrax Note Added: 0087306
2015-11-16 08:15 Cyrax File Added: types.pp.patch
2015-11-16 08:16 Cyrax Note Added: 0087307
2015-11-16 21:22 Marco van de Voort Note Added: 0087332
2015-11-16 21:40 Cyrax Note Added: 0087335
2015-11-17 00:38 Do-wan Kim File Added: tagsize_canvas.inc.patch
2015-11-17 00:55 lks Note Added: 0087346
2015-11-17 18:38 Bart Broersma Note Added: 0087363
2015-11-17 19:26 Marius Maximus Note Added: 0087366
2015-11-17 22:46 Mattias Gaertner Note Added: 0087370
2015-11-18 08:48 Marco van de Voort Note Added: 0087374
2015-11-18 08:48 Marco van de Voort Note Edited: 0087374 View Revisions
2015-11-18 12:33 Bart Broersma Note Added: 0087378
2015-11-18 12:34 Bart Broersma Note Edited: 0087378 View Revisions
2015-11-19 02:01 lks Note Added: 0087393
2015-11-19 10:06 Rik van Kekem Note Added: 0087397
2015-11-19 10:29 Mattias Gaertner Fixed in Revision => 50374
2015-11-19 10:29 Mattias Gaertner Note Added: 0087399
2015-11-19 10:29 Mattias Gaertner Status new => resolved
2015-11-19 10:29 Mattias Gaertner Resolution open => fixed
2015-11-19 10:29 Mattias Gaertner Assigned To => Mattias Gaertner
2015-11-19 11:43 Cyrax Note Added: 0087400
2015-11-19 11:43 Cyrax Status resolved => feedback
2015-11-19 11:43 Cyrax Resolution fixed => reopened
2015-11-19 11:55 Mattias Gaertner Note Added: 0087401
2015-11-19 12:54 Marco van de Voort Fixed in Revision 50374 => 50374(lazarus), 32361 (FPC)
2015-11-19 12:54 Marco van de Voort Note Added: 0087402
2015-11-19 12:54 Marco van de Voort Status feedback => resolved
2015-11-19 12:54 Marco van de Voort Fixed in Version => 3.1.1
2015-11-19 12:54 Marco van de Voort Resolution reopened => fixed
2015-11-21 20:51 Cyrax Status resolved => closed