diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2014-07-19 18:51:18 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-07-23 07:40:01 +0200 |
commit | 8642ef21b07e025a9aa117867811a725e2fb597e (patch) | |
tree | 3bb65365111a379cb4542e1f636d427e1bf9ae7d /include | |
parent | 61b2b557951a88441a88e37bb0014e158cc8a14d (diff) | |
download | cmocka-8642ef21b07e025a9aa117867811a725e2fb597e.tar.gz cmocka-8642ef21b07e025a9aa117867811a725e2fb597e.tar.bz2 cmocka-8642ef21b07e025a9aa117867811a725e2fb597e.zip |
cmocka: introduce LargestIntegralTypePrintfUnsignedFormat modifier
The modifier is almost identical to LargestIntegralTypePrintfFormat
in terms that it handles 64bit integer values, but unlike the latter
it prints them as unsigned value.
Behind the scenes it uses %I64u for windows, and %llu otherwise.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/cmocka.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/cmocka.h b/include/cmocka.h index a60b2a5..5814805 100644 --- a/include/cmocka.h +++ b/include/cmocka.h @@ -85,6 +85,15 @@ int __stdcall IsDebuggerPresent(); #endif /* _WIN32 */ #endif /* LargestIntegralTypePrintfFormat */ +/* Printf format used to display LargestIntegralType as unsigned. */ +#ifndef LargestIntegralTypePrintfUnsignedFormat +#ifdef _WIN32 +#define LargestIntegralTypePrintfUnsignedFormat "%I64u" +#else +#define LargestIntegralTypePrintfUnsignedFormat "%llu" +#endif /* _WIN32 */ +#endif /* LargestIntegralTypePrintfFormat */ + /* Perform an unsigned cast to LargestIntegralType. */ #define cast_to_largest_integral_type(value) \ ((LargestIntegralType)((size_t)(value))) |