Skip to content

Commit

Permalink
Add (u)intcap_t to stdint.h when CHERI is supported
Browse files Browse the repository at this point in the history
This allows using the non-underscore versions in hybrid CHERI code (purecap
should be using (u)intptr_t) in environments that use the compiler-provided
stdint.h instead of reimplementing it in their own headers (as is the case
for FreeBSD/CheriBSD).
  • Loading branch information
arichardson committed Jul 1, 2020
1 parent 2291020 commit c7ab6af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clang/lib/Headers/stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ typedef __UINTPTR_TYPE__ uintptr_t;
#define _UINTPTR_T
#endif

/* uintcap_t/intcap_t typedefs for hybrid CHERI code: */
#if __has_feature(capabilities)
typedef __intcap_t intcap_t;
typedef __uintcap_t uintcap_t;
#endif

/* C99 7.18.1.5 Greatest-width integer types.
*/
typedef __INTMAX_TYPE__ intmax_t;
Expand Down

0 comments on commit c7ab6af

Please sign in to comment.