Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread patspiper
On 25/02/14 13:57, Mattias Gaertner wrote: On Tue, 25 Feb 2014 13:22:41 +0200 patspiper wrote: [...] LCLIntf's (winapi.h) EnterCriticalsection(TCriticalSection) always takes precedence in compilation although codetools show it defined in threadh.inc: EnterCriticalsection(TRTLCriticalSection).

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Mattias Gaertner
On Tue, 25 Feb 2014 12:46:43 +0100 Sven Barth wrote: > Am 25.02.2014 12:14, schrieb Antonio Fortuny: > > > > Le 25/02/2014 12:04, Sven Barth a écrit : > >> Am 25.02.2014 11:22, schrieb Antonio Fortuny: > >>> Some help would be appreciated. > >> The function for initializing a TRTLCriticalSection

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Antonio Fortuny
Now I get it working on both platforms. Use InitCriticalSection and DoneCriticalsection (thanks Mattias) Using system.EnterCriticalSection and system.LeaveCriticalSection solves all the compilation problems and runs (thanks all) Thanks again Antonio. --- Ce courrier électronique ne contient

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Mattias Gaertner
On Tue, 25 Feb 2014 13:22:41 +0200 patspiper wrote: >[...] > LCLIntf's (winapi.h) EnterCriticalsection(TCriticalSection) always takes > precedence in compilation although codetools show it defined in > threadh.inc: EnterCriticalsection(TRTLCriticalSection). I added overload to LCL Enter/LeaveC

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Mattias Gaertner
On Tue, 25 Feb 2014 13:22:41 +0200 patspiper wrote: >[...] > LCLIntf's (winapi.h) EnterCriticalsection(TCriticalSection) always takes > precedence in compilation although codetools show it defined in > threadh.inc: EnterCriticalsection(TRTLCriticalSection). The compiler is very strict and requ

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Sven Barth
Am 25.02.2014 12:14, schrieb Antonio Fortuny: Le 25/02/2014 12:04, Sven Barth a écrit : Am 25.02.2014 11:22, schrieb Antonio Fortuny: Some help would be appreciated. The function for initializing a TRTLCriticalSection is InitCriticalSection, not InitializeCriticalSection. If you wouldn't use

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread patspiper
On 25/02/14 12:56, Mattias Gaertner wrote: On Tue, 25 Feb 2014 11:22:57 +0100 Antonio Fortuny wrote: [...] FIniCriticalSection: TRTLCriticalSection; ... InitializeCriticalSection(FIniCriticalSection); <- compilation error A TRTLCriticalSection is initialized

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Antonio Fortuny
Le 25/02/2014 12:04, Sven Barth a écrit : Am 25.02.2014 11:22, schrieb Antonio Fortuny: Hi Folks. Lazarus 1.0.2, FPC 2.6.2, Win32 and Linux x86_64 Something goes wrong with TRTRCriticalSection. There is a difference between Windows and Linux. In a program which will run on Win32 and Linux x86

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Michael Van Canneyt
On Tue, 25 Feb 2014, Sven Barth wrote: Am 25.02.2014 11:22, schrieb Antonio Fortuny: Hi Folks. Lazarus 1.0.2, FPC 2.6.2, Win32 and Linux x86_64 Something goes wrong with TRTRCriticalSection. There is a difference between Windows and Linux. In a program which wil

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Sven Barth
Am 25.02.2014 11:22, schrieb Antonio Fortuny: Hi Folks. Lazarus 1.0.2, FPC 2.6.2, Win32 and Linux x86_64 Something goes wrong with TRTRCriticalSection. There is a difference between Windows and Linux. In a program which will run on Win32 and Linux x86_64, using threads and all this stuff I nee

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread Mattias Gaertner
On Tue, 25 Feb 2014 11:22:57 +0100 Antonio Fortuny wrote: >[...] > FIniCriticalSection: TRTLCriticalSection; > ... > InitializeCriticalSection(FIniCriticalSection); <- > compilation error A TRTLCriticalSection is initialized with InitCriticalSection from the syst

Re: [Lazarus] TRTLCriticalSection

2014-02-25 Thread patspiper
On 25/02/14 12:22, Antonio Fortuny wrote: Hi Folks. Lazarus 1.0.2, FPC 2.6.2, Win32 and Linux x86_64 That's an old Lazarus version. Did you test with the most recent one? Something goes wrong with TRTRCriticalSection. There is a difference between Windows and Linux. In a program which will r

[Lazarus] TRTLCriticalSection

2014-02-25 Thread Antonio Fortuny
Hi Folks. Lazarus 1.0.2, FPC 2.6.2, Win32 and Linux x86_64 Something goes wrong with TRTRCriticalSection. There is a difference between Windows and Linux. 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 acces

Re: [Lazarus] TRTLCriticalSection

2013-12-01 Thread patspiper
On 29/11/13 13:32, Michael Van Canneyt wrote: On Fri, 29 Nov 2013, Antonio Fortuny wrote: Hi Folks. On Linux x86_°64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line EnterCriticalSection(CS); with the following compiler error: /home/sources/production/lib/usimplel

Re: [Lazarus] TRTLCriticalSection

2013-11-29 Thread Antonio Fortuny
Le 29/11/2013 12:32, Michael Van Canneyt a écrit : On Fri, 29 Nov 2013, Antonio Fortuny wrote: Hi Folks. On Linux x86_°64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line EnterCriticalSection(CS); with the following compiler error: /home/sources/production/lib/us

Re: [Lazarus] TRTLCriticalSection

2013-11-29 Thread Michael Van Canneyt
On Fri, 29 Nov 2013, Antonio Fortuny wrote: Hi Folks. On Linux x86_°64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line   EnterCriticalSection(CS); with the following compiler error: /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by var for arg no

Re: [Lazarus] TRTLCriticalSection

2013-11-29 Thread Sven Barth
Am 29.11.2013 12:00, schrieb Antonio Fortuny: Hi Folks. On Linux x86_°64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line * EnterCriticalSection(CS);* with the following compiler error: /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by var for arg

[Lazarus] TRTLCriticalSection

2013-11-29 Thread Antonio Fortuny
Hi Folks. On Linux x86_°64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line * EnterCriticalSection(CS);* with the following compiler error: /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by var for arg no. 1 has to match exactly:/*Got "Pointer" expec