mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This allows the conversion of the Windows `BOOL` type to be converted to `Bool` implicitly. The implicit bridging allows for a more ergonomic use of the native Windows APIs in Swift. Due to the ambiguity between the Objective C `BOOL` and the Windows `BOOL`, we must manually map the `BOOL` type to the appropriate type. This required lifting the mapping entry for `ObjCBool` from the mapped types XMACRO definition into the inline definition in the importer. Take the opportunity to simplify the mapping code. Adjust the standard library usage of the `BOOL` type which is now eclipsed by the new `WindowsBool` type, preferring to use `Bool` whenever possible. Thanks to Jordan Rose for the suggestion to do this and a couple of hints along the way.
12 lines
107 B
C
12 lines
107 B
C
|
|
#ifndef WINBOOL_H
|
|
#define WINBOOL_H
|
|
|
|
typedef int BOOL;
|
|
|
|
BOOL GetBOOL(void);
|
|
void TakeBOOL(BOOL);
|
|
|
|
#endif
|
|
|