Le 29/08/2022 à 01:41, James Richters via fpc-pascal a écrit :
If a special function is needed for some COM thing or weird Winapi thing, then 
that function should be part of the unit that needs it, not modifying the 
generic function intended to be used for general purpose applications output 
something that does not conform to other Pascal Boolean datatypes and just 
confuses everyone.
Unfortunately, it's not just a few windows functions which use this behaviour but the whole Windows API:

https://docs.microsoft.com/fr-fr/windows/win32/api/winuser/nf-winuser-getmessage?redirectedfrom=MSDN

The Microsoft BOOL datatype uses this convention so the whole ecosystem is attracted to use it (other C program on windows, Delphi, ... )

I imagine it's more efficient at the assembler level to process the result of functions returning boolean.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to