I have a C API that defines an enum like so:
typedef enum
{
C_ENUM_VALUE_NONE = 0,
C_ENUM_VALUE_APPLE = (1 << 0),
C_ENUM_VALUE_BANANA = (1
In the case of bitwise operations, the expression evaluates to a primitive type, i.e. int, long, etc. However, your function takes a non-primitive type (CEnumType). The only way I know of to bypass this is to cast the expression. For example:
do_something((CEnumType) (C_ENUM_VALUE_APPLE | C_ENUM_VALUE_BANANA));