Mercurial > ms-int-types
changeset 19:febb32e4ac04
Get rid of these compiler warnings when compiling for 32-bit:
warning C4311: 'type cast' : pointer truncation from 'void *' to 'uintptr_t'
warning C4312: 'type cast' : conversion from 'uintptr_t' to 'const void *' of greater size
author | ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde |
---|---|
date | Thu, 17 Jul 2008 05:47:22 +0000 |
parents | eb2525abe43a |
children | 9be805b7c8c6 |
files | stdint.h |
diffstat | 1 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/stdint.h +++ b/stdint.h @@ -1,7 +1,7 @@ // ISO C9x compliant stdint.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // -// Copyright (c) 2006 Alexander Chemeris +// Copyright (c) 2006-2008 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: @@ -53,6 +53,16 @@ } #endif +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types @@ -90,8 +100,8 @@ typedef uint64_t uint_fast64_t; typedef __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else // _WIN64 ][ - typedef int intptr_t; - typedef unsigned int uintptr_t; + typedef _W64 int intptr_t; + typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types