diff --git a/Cesium.Compiler/stdlib/stdint.h b/Cesium.Compiler/stdlib/stdint.h index 2691dff4..89ac5a41 100644 --- a/Cesium.Compiler/stdlib/stdint.h +++ b/Cesium.Compiler/stdlib/stdint.h @@ -38,3 +38,33 @@ #define UINT_FAST16_MAX UINT32_MAX #define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST64_MAX UINT64_MAX + +typedef signed char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef long long int64_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; + +typedef signed char int_least8_t; +typedef short int_least16_t; +typedef int int_least32_t; +typedef long long int_least64_t; +typedef unsigned char uint_least8_t; +typedef unsigned short uint_least16_t; +typedef unsigned int uint_least32_t; +typedef unsigned long long uint_least64_t; + +typedef signed char int_fast8_t; +typedef int int_fast16_t; +typedef int int_fast32_t; +typedef long long int_fast64_t; +typedef unsigned char uint_fast8_t; +typedef unsigned int uint_fast16_t; +typedef unsigned int uint_fast32_t; +typedef unsigned long long uint_fast64_t; + +typedef long long intmax_t; +typedef unsigned long long uintmax_t; diff --git a/Cesium.IntegrationTests/stdlib/types/integer.c b/Cesium.IntegrationTests/stdlib/types/integer.c new file mode 100644 index 00000000..2701f547 --- /dev/null +++ b/Cesium.IntegrationTests/stdlib/types/integer.c @@ -0,0 +1,40 @@ +#include +#include + +int main(void) +{ + printf("%zu\n", sizeof(int8_t)); + printf("%zu\n", sizeof(int16_t)); + printf("%zu\n", sizeof(int32_t)); + printf("%zu\n", sizeof(int64_t)); + + printf("%zu\n", sizeof(int_fast8_t)); + printf("%zu\n", sizeof(int_fast16_t)); + printf("%zu\n", sizeof(int_fast32_t)); + printf("%zu\n", sizeof(int_fast64_t)); + + printf("%zu\n", sizeof(int_least8_t)); + printf("%zu\n", sizeof(int_least16_t)); + printf("%zu\n", sizeof(int_least32_t)); + printf("%zu\n", sizeof(int_least64_t)); + + printf("%zu\n", sizeof(uint8_t)); + printf("%zu\n", sizeof(uint16_t)); + printf("%zu\n", sizeof(uint32_t)); + printf("%zu\n", sizeof(uint64_t)); + + printf("%zu\n", sizeof(uint_fast8_t)); + printf("%zu\n", sizeof(uint_fast16_t)); + printf("%zu\n", sizeof(uint_fast32_t)); + printf("%zu\n", sizeof(uint_fast64_t)); + + printf("%zu\n", sizeof(uint_least8_t)); + printf("%zu\n", sizeof(uint_least16_t)); + printf("%zu\n", sizeof(uint_least32_t)); + printf("%zu\n", sizeof(uint_least64_t)); + + printf("%zu\n", sizeof(intmax_t)); + printf("%zu\n", sizeof(intptr_t)); + printf("%zu\n", sizeof(uintmax_t)); + printf("%zu\n", sizeof(uintptr_t)); +}