[fpc-devel] Issue with Critical sections

Vinzent Hoefler JeLlyFish.software at gmx.net
Wed Apr 4 13:00:55 CEST 2007


On Wednesday 04 April 2007 10:33, Sergei Gorelkin wrote:

> I was porting to Linux some Windows code which uses critical
> sections API, and got 'Identifier not found' error on
> InitializeCriticalSection and DeleteCriticalSection symbols.

If I had to guess, I'd say this is probably because those identifiers 
come from the Windows unit.

> After
> searching through RTL code, I discovered that abovementioned
> functions are named InitCriticalSection and DoneCriticalSection. At
> the same time, the EnterCriticalSection and LeaveCriticalSection are
> not renamed, so code using them compiles without errors. Why this
> inconsistency?

Because one is the RTL abstraction on the different OSes, the other one 
is the direct Windows-API-Call.

> Should I supply a patch that adds
> Initialize/DeleteCriticalSection as aliases for
> Init/DoneCriticalSection?

No, I'd suggest to fix your code.


Regards,

Vinzent.




More information about the fpc-devel mailing list