non-encapsulated_union
typedef [switch_type(switch-type-specifier) [ , type-attr-list ] ] union [ tag ] {
[ case ( limited-expr-list) ]
[ [ field-attribute-list ] ] type-specifier declarator-list ;
[ [ default ]
[ [ field-attribute-list ] ] type-specifier declarator-list ;
]
}
-
switch-type-specifier
-
Specifies an integer, character, or enum type or an identifier of such a type.
-
type-attr-list
-
Specifies zero or more attributes that apply to the union type. Valid type attributes include handle, transmit_as; the pointer attribute unique, or ptr; and the usage attributes context_handle and ignore. Separate multiple attributes with commas.
-
tag
-
Specifies an optional tag.
-
limited-expr-list
-
Specifies one or more C-language expressions that are supported by MIDL. Almost all C expressions are supported. The MIDL compiler supports conditional expressions, logical expressions, relational expressions, and arithmetic expressions. MIDL does not allow function invocations in expressions and does not allow pre- and post-increment and -decrement operators.
-
field-attribute-list
-
Specifies zero or more field attributes that apply to the union member. Valid field attributes include first_is, last_is, length_is, max_is, size_is; the usage attributes string, ignore, and context_handle; the pointer attribute ref, unique, or ptr; and, for members that are themselves unions, the union attribute switch_type. Separate multiple field attributes with commas.
-
type-specifier
-
Specifies a base_type, struct, union, enum type, or type identifier. An optional storage specification can precede type-specifier.
-
declarator-list
-
Specifies one or more standard C declarators, such as identifiers, pointer declarators, and array declarators. (Function declarators and bit-field declarations are not allowed in unions that are transmitted in remote procedure calls. These declarators are allowed in unions that are not transmitted.) Separate multiple declarators with commas.
Remarks
The nonencapsulated union is indicated by the presence of the type attribute switch_type and the field attribute switch_is.
The shape of unions must be the same across platforms to ensure interconnectivity.
For more information, see switch_is and switch_type.
See Also
field_attributes, IDL, union