From a2f6210b3e1a7ff261855981fc06031f78cba8f4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 2 Nov 2004 22:14:34 +0000 Subject: [PATCH] Add compatibility macros for printf and scanf-ing 64-bit unsigned ints svn:r2648 --- src/common/compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/compat.h b/src/common/compat.h index 707a349f0b..97d264fd82 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -62,6 +62,16 @@ size_t strlcat(char *dst, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz); #endif +#ifdef MS_WINDOWS +#define U64_PRINTF_ARG(a) (a) +#define U64_SCANF_ARG(a) (a) +#dfeine U64_FORMAT "%I64u" +#else +#define U64_PRINTF_ARG(a) ((long long unsigned int)a) +#define U64_SCANF_ARG(a) ((long long unsigned int*)a) +#define U64_FORMAT "%llu" +#endif + int tor_snprintf(char *str, size_t size, const char *format, ...) CHECK_PRINTF(3,4); int tor_vsnprintf(char *str, size_t size, const char *format, va_list args);