diff options
author | David Drysdale <drysdale@google.com> | 2021-11-26 01:42:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-26 02:42:47 +0100 |
commit | 7bd23291e29e1874f57a628e94d7632b3b367ae6 (patch) | |
tree | a7381f98e6fb46c2020bccb344e98ba0e38523ab /tests/headers/blocklist-file.hpp | |
parent | 04f5c0715832feee6c059128cd5cd70056e861f7 (diff) |
Add --blocklist-file option (#2097)
Update Item to hold a `clang::SourceLocation` and use this to allow
blocklisting based on filename.
The existing code has a special case that always maps <stdint.h> integer
types to corresponding Rust integer types, even if the C types are
blocklisted. To match this special case behaviour, also treat these
C <stdint.h> types as being eligible for derived Copy/Clone/Debug
traits.
Fixes #2096
Diffstat (limited to 'tests/headers/blocklist-file.hpp')
-rw-r--r-- | tests/headers/blocklist-file.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/headers/blocklist-file.hpp b/tests/headers/blocklist-file.hpp new file mode 100644 index 00000000..ad8bcd66 --- /dev/null +++ b/tests/headers/blocklist-file.hpp @@ -0,0 +1,18 @@ +// bindgen-flags: --blocklist-file ".*/blocklisted/file.*" -- -Itests/headers + +// Forward declaration of struct that's defined in a blocklisted file. +struct StructWithBlocklistedDefinition; + +#include "blocklisted/file.hpp" +#include "blocklisted/fake-stdint.h" + +struct SizedIntegers { + uint8_t x; + uint16_t y; + uint32_t z; +}; + +// Actual definition of struct that has a forward declaration in a blocklisted file. +struct StructWithBlocklistedFwdDecl { + uint8_t b; +}; |