I noticed that, when I'm using inline assembly, bool functions and BOOL functions don't behave the same. Can anybody share some light on this?
Thanks!
-iago
[edit] I know that BOOL is typedeffed as an int, but bool seems to be native. But how are they different?
bool is a built-in data type.
(http://www.valhallalegends.com/zakath/BOOL.png)
sizeof(bool) == 1
sizeof(BOOL) == 4
That should account for most differences, I'd think.
ah, so bool only counts as 1? I figured they had left it as 4 for alignment.
Thanks :)
Quote from: iago on December 11, 2003, 01:51 PM
ah, so bool only counts as 1? I figured they had left it as 4 for alignment.
Thanks :)
It may be padded to 4 bytes depending on how and where it's used. In the case of function return values, though, typically only al will be set for x86.
Also, bool can be either true (1) or false (0), it cannot receive any other values. BOOL can receive any long/doubleword value and this is sometimes sloppily done in Win32 API. Examples: GetMessage return value, and the return value of WM_CTLCOLORSTATIC and its friends.