summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-02 22:14:34 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-02 22:14:34 +0000
commita2f6210b3e1a7ff261855981fc06031f78cba8f4 (patch)
tree9635901a2a15e05ec343a062489fff804d392563 /src/common
parent67f14032b18b7b46a56bd32ccb88923588603164 (diff)
downloadtor-a2f6210b3e1a7ff261855981fc06031f78cba8f4.tar.gz
tor-a2f6210b3e1a7ff261855981fc06031f78cba8f4.zip
Add compatibility macros for printf and scanf-ing 64-bit unsigned ints
svn:r2648
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.h10
1 files changed, 10 insertions, 0 deletions
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);