On 15 Dec 2002 at 0:49, Frank Heckenbach wrote:
J. David Bryan wrote:
[...]
Need? No, granted, just as there is no need for, e.g., alternate number bases in specifying constants. It's simply a convenience for interfacing with external C routines that use that convention (e.g., a few thousand Windows API routines).
Are you sure? Do they really write:
struct MyBool { int BoolField : 32; };
And not perhaps:
typedef int MyBool;
WinBool is defined as an "int". Many of the WinAPI routines that take a WinBool or BOOL parameter expect a 32-bit parameter. Long ago, I made the mistake of defining WinBool as "Boolean" instead of "Boolean (32)", and had no end of trouble with GUI Windows programs (e.g., endless loops with the messaging callbacks). It took me ages to discover what the problem was. Needless to say, I learnt my lesson.
The long and short of it: for as long as GPC expects to support Windows programmers, there is no way out of being able to declare a 32-bit Boolean type - and when Windows moves to 64-bits, we may well need a 64- bit Boolean type. Someone (not Frank) suggested a simple arithmetical expression (e.g., x =/<> 0). For reasons stated elsewhere, I personally would prefer to avoid the contortions necessary to use such constructs.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/