X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Finttypes.h;h=58debd00f67542ed751bacc4f320789948f83c83;hp=3bdac35c160925aae2a0b3aef5c6b45a66cdefa0;hb=c29459b08eca95418fbdee714a1c59f3becdb2ce;hpb=95bd04e16acacde19fcfdcc722baf72b06dcdfee diff --git a/source/core/inttypes.h b/source/core/inttypes.h index 3bdac35..58debd0 100644 --- a/source/core/inttypes.h +++ b/source/core/inttypes.h @@ -46,6 +46,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 +60,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