Menu

#18 patch for TRTLCriticalSection in OdbcApi.pas

open
nobody
None
5
2004-10-08
2004-10-08
No

Hi
I come back with my TRLCriticalSection which doesn't
compile under LINUX, as TRTLCriticalSection is not
known on linux, even having
TTRLCriticalSection=TCriticalSection.

so here is the patch (wich works as on Windows than
Linux) (and which prevent me to make the same
modifications at each update of odbcapi.pas)

Thanks

Index: OdbcApi.pas

RCS file:
/cvs/cvs/_repository/dev/unit/outils/dbxoodbc/odbc/OdbcApi.pas,v
retrieving revision 1.15
diff -r1.15 OdbcApi.pas
74c74
< SysUtils, SysConst {$IFNDEF LINUX}, Windows{$ENDIF};
---
> SysUtils, SysConst, {$IFNDEF LINUX}
Windows{$ENDIF}, SyncObjs;
3563,3566d3562
< {$IFDEF LINUX}
< TRTLCriticalSection = TCriticalSection;
< {$ENDIF}
<
5025c5021
< fLockObj: TRTLCriticalSection;
---
> fLockObj: TCriticalSection;
5043c5039
< InitializeCriticalSection(fLockObj);
---
> fLockObj:=TCriticalSection.Create;
5049c5045
< DeleteCriticalSection(fLockObj);
---
> fLockObj.Free;
5143c5139
< EnterCriticalSection(fLockObj);
---
> fLockObj.Acquire;
5148c5144
< LeaveCriticalSection(fLockObj);
---
> fLockObj.Release;

Discussion

  • Vadim V.Lopushanskiy

    Logged In: YES
    user_id=644745

    You receive what message from the compiler? Try to specify:
    TRTLCriticalSection = class(TCriticalSection);

     
  • Thierry Nivon

    Thierry Nivon - 2004-10-18

    Logged In: YES
    user_id=993154

    In fact it's the function as InitializeCriticalSection,
    EnterCriticalSection, ...
    which are define in libc
    but why not to user the TCriticalSection which works on
    Windows as on Linux

     
  • Vadim V.Lopushanskiy

    Logged In: YES
    user_id=644745

    I shall include your correction in the following version.

     

Log in to post a comment.