Add missing inttypes header for musl-libc (dotnet/coreclr#5729)
authorPeter Jas <necmon@yahoo.com>
Tue, 14 Jun 2016 20:56:27 +0000 (23:56 +0300)
committerJan Kotas <jkotas@microsoft.com>
Tue, 14 Jun 2016 20:56:27 +0000 (13:56 -0700)
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
src/coreclr/src/pal/src/safecrt/output.inl
src/coreclr/src/pal/src/safecrt/safecrt_input_s.c
src/coreclr/src/pal/src/safecrt/safecrt_output_l.c
src/coreclr/src/pal/src/safecrt/safecrt_output_s.c
src/coreclr/src/pal/src/safecrt/safecrt_winput_s.c
src/coreclr/src/pal/src/safecrt/safecrt_woutput_s.c

index c9b185e..eaad174 100644 (file)
@@ -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)
index d28ace9..ae0692e 100644 (file)
@@ -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        */
index ba0e098..6ba607c 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <locale.h>
 #include <stdarg.h>
+#include <inttypes.h>
 
 #include "internal_securecrt.h"
 
index c47d2c8..d6844f4 100644 (file)
@@ -27,6 +27,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <stdlib.h>
+#include <inttypes.h>
 #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        */
index f9a17e6..c3e7f91 100644 (file)
@@ -28,6 +28,7 @@
 #include <limits.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <inttypes.h>
 #include "internal_securecrt.h"
 
 #include "mbusafecrt_internal.h"
index 89f1722..17a6217 100644 (file)
@@ -34,7 +34,7 @@
 #include <stdlib.h>
 #include <locale.h>
 #include <stdarg.h>
-
+#include <inttypes.h>
 #include "internal_securecrt.h"
 
 #include "mbusafecrt_internal.h"
index db7bbdb..52fe940 100644 (file)
@@ -28,6 +28,7 @@
 #include <limits.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <inttypes.h>
 #include "internal_securecrt.h"
 
 #include "mbusafecrt_internal.h"