| 1 | // vim: set ft=cpp: |
| 2 | |
| 3 | // Because implementations are allowed to define things in the global |
| 4 | // namespace even when C++ headers (e.g. cstdint vs stdint.h) are |
| 5 | // included, include-what-you-use gets confused and thinks this header |
| 6 | // is superfluous. It _is_ superfluous on implementations which pollute |
| 7 | // the global namespace, but since that’s not guaranteed, this header is |
| 8 | // necessary for portability. Instruct IWYU to not suggest removing it. |
| 9 | // |
| 10 | // IWYU pragma: always_keep |
| 11 | |
| 12 | #ifndef ZTERP_TYPES_H |
| 13 | #define ZTERP_TYPES_H |
| 14 | |
| 15 | // Unless deprecated C headers are included, various types (size_t, |
| 16 | // uint8_t, etc) are only guaranteed to be declared in the std |
| 17 | // namespace, not necessary globally. Such headers are not included in |
| 18 | // Bocfel because they pollute the global namespace, but these types are |
| 19 | // used all over the place so bring them into the global namespace here. |
| 20 | |
| 21 | #include <cstddef> |
| 22 | #include <cstdint> |
| 23 | |
| 24 | using std::size_t; |
| 25 | using std::int8_t; |
| 26 | using std::int16_t; |
| 27 | using std::int32_t; |
| 28 | using std::uint8_t; |
| 29 | using std::uint16_t; |
| 30 | using std::uint32_t; |
| 31 | |
| 32 | #endif |