mbox series

[00/11] predefined macros for intmax_t/intptr_t/...

Message ID 20181209234320.65274-1-luc.vanoostenryck@gmail.com (mailing list archive)
Headers show
Series predefined macros for intmax_t/intptr_t/... | expand

Message

Luc Van Oostenryck Dec. 9, 2018, 11:43 p.m. UTC
Some types have already their TYPE/SIZEOF/MAX macros.
These patches add them for the missing types: ptrdiff,
int{ptr,max,64,32,16,8}_t and their unsigned version.

Note: some of the types vary a lot depending on the
      architecture, OS & exact ABI used. This is
      specially the case for for int32_t.
      The definition in these patches should be correct
      for the most common archs & ABI used for the kernel
      but it can't possibly be correct for all cases.

Luc Van Oostenryck (11):
  testsuite: test predef macros on LP32/LP64/LLP64
  fix '__SIZE_TYPE__' for LLP64
  allow optional "_T" suffix to __SIZEOF_XXX__
  add builtin_type_suffix()
  make predefined_type_size() more generic
  give a type to wchar
  add predefined macros for [u]intptr & ptrdiff
  add predefined macros for [u]int_max
  add predefined macros for [u]int{8,16}_t
  add predefined macros for [u]int64_t
  add predefined macros for [u]int32_t

 char.c                                    |   4 +-
 lib.c                                     | 121 +++++++++++++++-------
 show-parse.c                              |  73 +++++++------
 symbol.h                                  |   1 +
 target.c                                  |   9 +-
 target.h                                  |   9 +-
 validation/preprocessor/predef-char-bit.c |  16 ---
 validation/preprocessor/predef-llp64.c    |   9 ++
 validation/preprocessor/predef-lp32.c     |   9 ++
 validation/preprocessor/predef-lp64.c     |   9 ++
 validation/preprocessor/predef-max.c      |  18 ----
 validation/preprocessor/predef-sizeof.c   |  25 -----
 validation/preprocessor/predef.c          |  45 ++++++++
 13 files changed, 212 insertions(+), 136 deletions(-)
 delete mode 100644 validation/preprocessor/predef-char-bit.c
 create mode 100644 validation/preprocessor/predef-llp64.c
 create mode 100644 validation/preprocessor/predef-lp32.c
 create mode 100644 validation/preprocessor/predef-lp64.c
 delete mode 100644 validation/preprocessor/predef-max.c
 delete mode 100644 validation/preprocessor/predef-sizeof.c
 create mode 100644 validation/preprocessor/predef.c