summaryrefslogtreecommitdiff
path: root/bindgen-integration/cpp/Test.h
diff options
context:
space:
mode:
Diffstat (limited to 'bindgen-integration/cpp/Test.h')
-rw-r--r--bindgen-integration/cpp/Test.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/bindgen-integration/cpp/Test.h b/bindgen-integration/cpp/Test.h
index 01c7aea1..4b8c1690 100644
--- a/bindgen-integration/cpp/Test.h
+++ b/bindgen-integration/cpp/Test.h
@@ -49,7 +49,7 @@ struct Second {
};
enum ItemKind {
- ITEM_KIND_UNO,
+ ITEM_KIND_UNO = 0,
ITEM_KIND_DOS,
ITEM_KIND_TRES,
};
@@ -63,6 +63,35 @@ struct Third {
bool assert(int first, bool second, ItemKind third);
};
+enum MyEnum {
+ ONE = 0,
+ TWO,
+ THREE,
+ FOUR,
+};
+
+struct Fourth {
+ MyEnum tag: 2;
+ unsigned long ptr: 48;
+
+ /// Returns true if the bitfields match the arguments, false otherwise.
+ bool assert(MyEnum tag, unsigned long ptr);
+};
+
+struct Date2 {
+ unsigned short nWeekDay : 3; // 0..7 (3 bits)
+ unsigned short nMonthDay : 6; // 0..31 (6 bits)
+ unsigned short nMonth : 5; // 0..12 (5 bits)
+ unsigned short nYear : 8; // 0..100 (8 bits)
+ unsigned char byte : 8;
+
+ bool assert(unsigned short nWeekDay,
+ unsigned short nMonthDay,
+ unsigned short nMonth,
+ unsigned short nYear,
+ unsigned short byte);
+};
+
} // namespace bitfields
struct AutoRestoreBool {