From 248400279d9ac08ffba3be1005f01be39ee0aec4 Mon Sep 17 00:00:00 2001 From: Peter Jas Date: Tue, 14 Jun 2016 23:56:27 +0300 Subject: [PATCH] Add missing inttypes header for musl-libc (dotnet/coreclr#5729) Also replaced the usages of `__unit64_t` and `__int64_t` with `uint64_t` and `int64_t` respectively. Commit migrated from https://github.com/dotnet/coreclr/commit/453b4e92c5f37e0ca88f6e32e5cc10c124fd678d --- src/coreclr/src/pal/src/safecrt/input.inl | 6 +++--- src/coreclr/src/pal/src/safecrt/output.inl | 2 +- src/coreclr/src/pal/src/safecrt/safecrt_input_s.c | 1 + src/coreclr/src/pal/src/safecrt/safecrt_output_l.c | 3 ++- src/coreclr/src/pal/src/safecrt/safecrt_output_s.c | 1 + src/coreclr/src/pal/src/safecrt/safecrt_winput_s.c | 2 +- src/coreclr/src/pal/src/safecrt/safecrt_woutput_s.c | 1 + 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/coreclr/src/pal/src/safecrt/input.inl b/src/coreclr/src/pal/src/safecrt/input.inl index c9b185e..eaad174 100644 --- a/src/coreclr/src/pal/src/safecrt/input.inl +++ b/src/coreclr/src/pal/src/safecrt/input.inl @@ -258,7 +258,7 @@ static int __check_float_string(size_t nFloatStrUsed, #endif /* ALLOC_TABLE */ #if _INTEGRAL_MAX_BITS >= 64 - __uint64_t num64 = 0LL; /* temp for 64-bit integers */ + uint64_t num64 = 0LL; /* temp for 64-bit integers */ #endif /* _INTEGRAL_MAX_BITS >= 64 */ void *pointer=NULL; /* points to user data receptacle */ void *start; /* indicate non-empty string */ @@ -927,7 +927,7 @@ getnum: } /* end of WHILE loop */ if (negative) - num64 = (__uint64_t )(-(__int64)num64); + num64 = (uint64_t )(-(__int64)num64); } else { #endif /* _INTEGRAL_MAX_BITS >= 64 */ @@ -984,7 +984,7 @@ getnum: assign_num: #if _INTEGRAL_MAX_BITS >= 64 if ( integer64 ) - *(__int64 UNALIGNED *)pointer = ( __uint64_t )num64; + *(__int64 UNALIGNED *)pointer = ( uint64_t )num64; else #endif /* _INTEGRAL_MAX_BITS >= 64 */ if (longone) diff --git a/src/coreclr/src/pal/src/safecrt/output.inl b/src/coreclr/src/pal/src/safecrt/output.inl index d28ace9..ae0692e 100644 --- a/src/coreclr/src/pal/src/safecrt/output.inl +++ b/src/coreclr/src/pal/src/safecrt/output.inl @@ -1215,7 +1215,7 @@ int __cdecl _output ( /* appropriately. */ #if _INTEGRAL_MAX_BITS >= 64 - __uint64_t number; /* number to convert */ + uint64_t number; /* number to convert */ int digit; /* ascii value of digit */ __int64 l; /* temp long value */ #else /* _INTEGRAL_MAX_BITS >= 64 */ diff --git a/src/coreclr/src/pal/src/safecrt/safecrt_input_s.c b/src/coreclr/src/pal/src/safecrt/safecrt_input_s.c index ba0e098..6ba607c 100644 --- a/src/coreclr/src/pal/src/safecrt/safecrt_input_s.c +++ b/src/coreclr/src/pal/src/safecrt/safecrt_input_s.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "internal_securecrt.h" diff --git a/src/coreclr/src/pal/src/safecrt/safecrt_output_l.c b/src/coreclr/src/pal/src/safecrt/safecrt_output_l.c index c47d2c8..d6844f4 100644 --- a/src/coreclr/src/pal/src/safecrt/safecrt_output_l.c +++ b/src/coreclr/src/pal/src/safecrt/safecrt_output_l.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "internal_securecrt.h" #include "mbusafecrt_internal.h" @@ -1058,7 +1059,7 @@ int __cdecl _output ( #if _INTEGRAL_MAX_BITS >= 64 // unsigned __int64 number; /* number to convert */ - __uint64_t number; /* number to convert */ + uint64_t number; /* number to convert */ int digit; /* ascii value of digit */ __int64 l; /* temp long value */ #else /* _INTEGRAL_MAX_BITS >= 64 */ diff --git a/src/coreclr/src/pal/src/safecrt/safecrt_output_s.c b/src/coreclr/src/pal/src/safecrt/safecrt_output_s.c index f9a17e6..c3e7f91 100644 --- a/src/coreclr/src/pal/src/safecrt/safecrt_output_s.c +++ b/src/coreclr/src/pal/src/safecrt/safecrt_output_s.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "internal_securecrt.h" #include "mbusafecrt_internal.h" diff --git a/src/coreclr/src/pal/src/safecrt/safecrt_winput_s.c b/src/coreclr/src/pal/src/safecrt/safecrt_winput_s.c index 89f1722..17a6217 100644 --- a/src/coreclr/src/pal/src/safecrt/safecrt_winput_s.c +++ b/src/coreclr/src/pal/src/safecrt/safecrt_winput_s.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include "internal_securecrt.h" #include "mbusafecrt_internal.h" diff --git a/src/coreclr/src/pal/src/safecrt/safecrt_woutput_s.c b/src/coreclr/src/pal/src/safecrt/safecrt_woutput_s.c index db7bbdb..52fe940 100644 --- a/src/coreclr/src/pal/src/safecrt/safecrt_woutput_s.c +++ b/src/coreclr/src/pal/src/safecrt/safecrt_woutput_s.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "internal_securecrt.h" #include "mbusafecrt_internal.h" -- 2.7.4