summaryrefslogtreecommitdiff
path: root/bindgen-tests/tests/headers/short-enums.hpp
blob: 14f833de648b5b5de25109f2db1f2a4bb10a6517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// bindgen-flags: --rustified-enum ".*" -- -std=c++11 -fshort-enums

typedef enum {
    SOME_VALUE = 0x1,
} one_byte_t;

static_assert(sizeof(one_byte_t) == 1, "Short enums should work");

typedef enum {
    SOME_OTHER_VALUE = 0x100,
} two_byte_t;

static_assert(sizeof(two_byte_t) == 2, "");

typedef enum {
    SOME_BIGGER_VALUE = 0x1000000,
} four_byte_t;

static_assert(sizeof(four_byte_t) == 4, "");