Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-10

How do I fix win32object.inc errors compiling Win64 Lazarus trunk+FPC trunk?

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Building Laz trunk+FPC trunk on Windows I get

win32object.inc(565,78) Error: Incompatible type for arg no. 4: Got "<address of procedure(QWord;LongWord;LongWord;LongWord);StdCall>", expected "<procedure variable type of
procedure(QWord;LongWord;QWord;LongWord);StdCall>" win32int.pp(328) Fatal: There were 1 errors compiling module, stopping

Probably due to FPC trunk FPC r22526
Eg changes like
-function SetTimer(hWnd:HWND; nIDEvent:UINT; uElapse:UINT;
lpTimerFunc:TIMERPROC):UINT; external 'user32' name 'SetTimer';
+function SetTimer(hWnd:HWND; nIDEvent:UINT_PTR; uElapse:UINT;
lpTimerFunc:TIMERPROC):UINT_PTR; external 'user32' name 'SetTimer';

My pointer magic is still weak - what do I need to modify here: I obviously need to go from the pointer to the UINT to the UINT itself, but my messing with @ didn't work...

function TWin32WidgetSet.CreateTimer(Interval: integer; TimerFunc:
TWSTimerProc) : THandle;
...
    {$IF FPC_FULLVERSION>=20701}
    // Windows function fixes in FPC r22526
    TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval,
@TimerCallBackProc);
    {$ELSE}
    TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval,
@TimerCallBackProc);
    {$ENDIF}

Thanks,
Reinier

Reply by email

Vincent Snijders
to Reinier Olislagers

2012/10/11 Reinier Olislagers :

Show quoted text 30 lines
Building Laz trunk+FPC trunk on Windows I get win32object.inc(565,78) Error: Incompatible type for arg no. 4: Got "<address of procedure(QWord;LongWord;LongWord;LongWord);StdCall>", expected "<procedure variable type of procedure(QWord;LongWord;QWord;LongWord);StdCall>" win32int.pp(328) Fatal: There were 1 errors compiling module, stopping Probably due to FPC trunk FPC r22526 Eg changes like -function SetTimer(hWnd:HWND; nIDEvent:UINT; uElapse:UINT; lpTimerFunc:TIMERPROC):UINT; external 'user32' name 'SetTimer'; +function SetTimer(hWnd:HWND; nIDEvent:UINT_PTR; uElapse:UINT; lpTimerFunc:TIMERPROC):UINT_PTR; external 'user32' name 'SetTimer'; My pointer magic is still weak - what do I need to modify here: I obviously need to go from the pointer to the UINT to the UINT itself, but my messing with @ didn't work... function TWin32WidgetSet.CreateTimer(Interval: integer; TimerFunc: TWSTimerProc) : THandle; ... {$IF FPC_FULLVERSION>=20701} // Windows function fixes in FPC r22526 TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval, @TimerCallBackProc); {$ELSE} TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval, @TimerCallBackProc); {$ENDIF}

Did you look at the patch supplied with the bug report I gave you?

IMHO, that patch is correct, except:
* use UINTPTR instead of THandle as record field.
* make sure it still compiles/runs with fpc 2.6.0, at least as good as the current version.

Vincent

Reply by email

Reinier Olislagers
to Vincent Snijders
Vincent Snijders wrote 8 lines
2012/10/11 Reinier Olislagers : Did you look at the patch supplied with the bug report I gave you? IMHO, that patch is correct, except: * use UINTPTR instead of THandle as record field. * make sure it still compiles/runs with fpc 2.6.0, at least as good as the current version.

Thanks, Vincent ;)

Patch attached to issue, compiles both on x64/fpctrunk and x86 FPC 2.6.1.

Reply by email

Marco van de Voort
to Reinier Olislagers
Reinier Olislagers wrote 8 lines
> IMHO, that patch is correct, except: > * use UINTPTR instead of THandle as record field. > * make sure it still compiles/runs with fpc 2.6.0, at least as good as > the current version. Thanks, Vincent ;) Patch attached to issue, compiles both on x64/fpctrunk and x86 FPC 2.6.1.

Note that it is scheduled to be merged to fixes in a few weeks.

Reply by email

Reinier Olislagers
to Marco van de Voort
Marco van de Voort wrote 11 lines
On Thu, Oct 11, 2012 at 10:25:17AM +0200, Reinier Olislagers wrote: >> IMHO, that patch is correct, except: >> * use UINTPTR instead of THandle as record field. >> * make sure it still compiles/runs with fpc 2.6.0, at least as good as >> the current version. > > Thanks, Vincent ;) > > Patch attached to issue, compiles both on x64/fpctrunk and x86 FPC 2.6.1. Note that it is scheduled to be merged to fixes in a few weeks.

Noticed backport to FPC 2.6.1; updated patch attached to issue http://bugs.freepascal.org/view.php?id=23052

Suggest it be applied and marked for inclusion in Lazarus fixes.

Thanks,
Reinier

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 21 lines
On 11-10-2012 19:29, Marco van de Voort wrote: > On Thu, Oct 11, 2012 at 10:25:17AM +0200, Reinier Olislagers wrote: >>> IMHO, that patch is correct, except: >>> * use UINTPTR instead of THandle as record field. >>> * make sure it still compiles/runs with fpc 2.6.0, at least as good as >>> the current version. >> >> Thanks, Vincent ;) >> >> Patch attached to issue, compiles both on x64/fpctrunk and x86 FPC 2.6.1. > > Note that it is scheduled to be merged to fixes in a few weeks. Noticed backport to FPC 2.6.1; updated patch attached to issue http://bugs.freepascal.org/view.php?id=23052 Suggest it be applied and marked for inclusion in Lazarus fixes. Thanks, Reinier

Bump.

Could somebody have a look if they have time? The bug's not been assigned to somebody yet.

Thanks,
Reinier

Reply by email

Reinier Olislagers
to luiz americo pereira camara
luiz americo pereira camara wrote 16 lines
2012/10/25 Reinier Olislagers < <mailto:>> Bump. Could somebody have a look if they have time? The bug's not been assigned to somebody yet. Should be fixed Please, test

Thanks, Luiz, works fine when building a win32=>win64 cross compiler both FPC 2.6.1 and it works with fpc trunk x64.

Reply by email