mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In Windows, ClangImporter seems to execute with Microsoft compatibility, and there are some more warnings that do not happen in Unix. One of them seems to be -Wmicrosoft-enum-forward-reference which warns about forward defined enums, like the one that happens in this header. Since the -warnings-as-errors flag is now passed down to ClangImporter, this warning will make this test fail. Simply use the #pragma to disable the warning for this piece of code.
20 lines
646 B
C
20 lines
646 B
C
#if defined(CF_ENUM)
|
|
# error "This test requires controlling the definition of CF_ENUM"
|
|
#endif
|
|
|
|
// Make this C-compatible by leaving out the type.
|
|
#define CF_ENUM(_name) enum _name _name; enum _name
|
|
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wmicrosoft-enum-forward-reference"
|
|
typedef CF_ENUM(EnumWithDefaultExhaustivity) {
|
|
EnumWithDefaultExhaustivityLoneCase
|
|
};
|
|
|
|
// This name is also specially recognized by Swift.
|
|
#define __CF_ENUM_ATTRIBUTES __attribute__((enum_extensibility(open)))
|
|
typedef CF_ENUM(EnumWithSpecialAttributes) {
|
|
EnumWithSpecialAttributesLoneCase
|
|
} __CF_ENUM_ATTRIBUTES;
|
|
#pragma clang diagnostic pop
|