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, wchar_t, wint_t, char{16,32}_t.. 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 now be correct for the most common archs & ABI used for the kernel. Changes since v1: * correct _MAX value of unsigned types (+ testing) * fix definition PTYPE_WIDTH/PTYPE_TYPE * fix inverted type for INT8/UINT8 * define shortcur PTYPE_ALL_T * add tests for PTRDIFF/SIZE/INTMAX/INT{8,16,32,64} * add definitions for wint_t, char16_t & char32t Changes since v2: * mv slong_ctype's entry in typenames after long_ctype * use the type for predefined_max() * add a temptative arch_mach initialized with the native architecture and use it to set more correctly wchar_t, int32_t, ... * fix size of long double, especially on x86-64 This series is available for review & testing in the repository at: git://github.com/lucvoo/sparse-dev.git predefs-v2 ---------------------------------------------------------------- Luc Van Oostenryck (19): add detection of native platform Consolidate 'machine detection' into "machine.h" test endianness with __BYTE_ORDER__ testsuite: test predef macros on LP32/LP64/LLP64 fix '__SIZE_TYPE__' for LLP64 allow optional "_T" suffix to __SIZEOF_XXX__ use bits_mask() for predefined_max() add builtin_type_suffix() make predefined_type_size() more generic give a type to wchar use the type for predefined_max() add predefined macros for wint_t add predefined macros for [u]intptr add predefined macros for [u]intmax add predefined macros for [u]int{8,16}_t add predefined macros for [u]int64_t add predefined macros for [u]int32_t add predefined macros for char{16,32}_t fix the size of long double char.c | 4 +- lib.c | 153 +++++++++++++--------- lib.h | 1 + machine.h | 77 +++++++++++ show-parse.c | 73 ++++++----- symbol.h | 2 + target.c | 84 +++++++++++- target.h | 10 +- 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 | 57 ++++++++ 15 files changed, 386 insertions(+), 161 deletions(-) create mode 100644 machine.h 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 -- 2.19.2