<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 25.02.2014 11:22, schrieb Antonio
Fortuny:<br>
</div>
<blockquote cite="mid:lehqtk$c09$1@ger.gmane.org" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<font face="Helvetica, Arial, sans-serif">Hi Folks.<br>
<br>
Lazarus 1.0.2, FPC 2.6.2, Win32 and Linux x86_64<br>
Something goes wrong with TRTRCriticalSection. There is a
difference between Windows and Linux.<br>
In a program which will run on Win32 and Linux x86_64, using
threads and all this stuff I need to protect some code from
multi-threading access.<br>
One critical section looks enough to do the job.<br>
So i code this in Win32 and Linux:<br>
<br>
</font></blockquote>
<font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
Arial, sans-serif">[snip]</font></font><br>
<blockquote cite="mid:lehqtk$c09$1@ger.gmane.org" type="cite"><font
face="Helvetica, Arial, sans-serif"> On the above line marked as
compilation error the compiler complains with the message<br>
autoupdateserverthread.pas(255,48) Error: Call by var for arg
no. 1 has to match exactly: Got "TRTLCriticalSection" expected
"QWord"<br>
<b><big>winapi.inc</big></b>(650,11) Hint: Found declaration:
InitializeCriticalSection(var QWord);<br>
winapi ??? Why on Linux ?<br>
No way to get rid of this compilation error<br>
In Win32 the program compiles and runs without errors.<br>
<br>
Some help would be appreciated.</font><br>
</blockquote>
The function for initializing a TRTLCriticalSection is
InitCriticalSection, not InitializeCriticalSection. If you wouldn't
use the Windows unit you'd have seen this error on Windows as well.<br>
<br>
@Michael: maybe we should add a seealso for the
Init-/Enter-/Leave-/DoneCriticalSection functions to the
documentation of the TRTLCriticalSection type.<br>
<br>
Regards,<br>
Sven<br>
</body>
</html>