[or-cvs] Add compatibility macros for printf and scanf-ing 64-bit un...
Nick Mathewson
nickm at seul.org
Tue Nov 2 22:14:36 UTC 2004
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv20498/src/common
Modified Files:
compat.h
Log Message:
Add compatibility macros for printf and scanf-ing 64-bit unsigned ints
Index: compat.h
===================================================================
RCS file: /home/or/cvsroot/src/common/compat.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- compat.h 2 Nov 2004 19:25:52 -0000 1.3
+++ compat.h 2 Nov 2004 22:14:34 -0000 1.4
@@ -62,6 +62,16 @@
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);
More information about the tor-commits
mailing list