X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Finttypes.h;h=c0af5ca9f2d2cf485b7a84d56285835087e3119c;hp=3bdac35c160925aae2a0b3aef5c6b45a66cdefa0;hb=c3e242c2629cbc9645258b30aaf07b7285d4372b;hpb=4bd704ea84b36dc8e83db51cd5eab4111eb48c2a diff --git a/source/core/inttypes.h b/source/core/inttypes.h index 3bdac35..c0af5ca 100644 --- a/source/core/inttypes.h +++ b/source/core/inttypes.h @@ -14,7 +14,11 @@ typedef TypeList::Ty #if defined(__GNUC__) #if (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=6)) && defined(__LP64__) #pragma GCC diagnostic push +#if __GNUC__>=5 +#pragma GCC diagnostic ignored "-Wpedantic" +#else #pragma GCC diagnostic ignored "-pedantic" +#endif typedef TypeList::Type PlatformSignedTypes; typedef TypeList::Type PlatformUnsignedTypes; #pragma GCC diagnostic pop @@ -46,6 +50,11 @@ struct Int typedef typename TypeChooser::Type UnsignedType; }; +/** A helper for choosing an integer that's the same size as another type. */ +template +struct MatchingInt: Int +{ }; + // Finally define convenient shorthands for the actual integer types typedef Int<8>::SignedType Int8; typedef Int<8>::UnsignedType UInt8; @@ -55,6 +64,7 @@ typedef Int<32>::SignedType Int32; typedef Int<32>::UnsignedType UInt32; typedef Int<64>::SignedType Int64; typedef Int<64>::UnsignedType UInt64; +typedef MatchingInt::UnsignedType IntPtr; } // namespace Msp