[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Add compatibility macros for printf and scanf-ing 64-bit un...
- To: or-cvs@freehaven.net
- Subject: [or-cvs] Add compatibility macros for printf and scanf-ing 64-bit un...
- From: nickm@seul.org (Nick Mathewson)
- Date: Tue, 2 Nov 2004 17:14:36 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Tue, 02 Nov 2004 17:14:54 -0500
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
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);