xref: /third_party/rust/crates/bindgen/bindgen-tests/tests/headers/short-enums.hpp
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/rust/crates/bindgen/bindgen-tests/tests/headers/
112a9d9c8Sopenharmony_ci// bindgen-flags: --rustified-enum ".*" -- -std=c++11 -fshort-enums
212a9d9c8Sopenharmony_ci
312a9d9c8Sopenharmony_citypedef enum {
412a9d9c8Sopenharmony_ci    SOME_VALUE = 0x1,
512a9d9c8Sopenharmony_ci} one_byte_t;
612a9d9c8Sopenharmony_ci
712a9d9c8Sopenharmony_cistatic_assert(sizeof(one_byte_t) == 1, "Short enums should work");
812a9d9c8Sopenharmony_ci
912a9d9c8Sopenharmony_citypedef enum {
1012a9d9c8Sopenharmony_ci    SOME_OTHER_VALUE = 0x100,
1112a9d9c8Sopenharmony_ci} two_byte_t;
1212a9d9c8Sopenharmony_ci
1312a9d9c8Sopenharmony_cistatic_assert(sizeof(two_byte_t) == 2, "");
1412a9d9c8Sopenharmony_ci
1512a9d9c8Sopenharmony_citypedef enum {
1612a9d9c8Sopenharmony_ci    SOME_BIGGER_VALUE = 0x1000000,
1712a9d9c8Sopenharmony_ci} four_byte_t;
1812a9d9c8Sopenharmony_ci
1912a9d9c8Sopenharmony_cistatic_assert(sizeof(four_byte_t) == 4, "");
20

Indexes created Thu Nov 07 10:32:03 CST 2024