mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
r12006@catbus: nickm | 2007-02-28 16:06:24 -0500
On mingw, use "%I64u" to printf/scanf 64-bit integers, instead of the usual GCC "%llu". This prevents a bug when saving 64-bit int configuration values on mingw; the high-order 32 bits would get truncated. If the value was then reloaded, disaster would occur. (Fixes bug 400 and maybe also bug 397.) Backport candidate. svn:r9691
This commit is contained in:
+6
-2
@@ -123,15 +123,19 @@ size_t strlcpy(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2));
|
||||
#ifdef _MSC_VER
|
||||
#define U64_PRINTF_ARG(a) (a)
|
||||
#define U64_SCANF_ARG(a) (a)
|
||||
#define U64_FORMAT "%I64u"
|
||||
#define U64_LITERAL(n) (n ## ui64)
|
||||
#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"
|
||||
#define U64_LITERAL(n) (n ## llu)
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||
#define U64_FORMAT "%I64u"
|
||||
#else
|
||||
#define U64_FORMAT "%llu"
|
||||
#endif
|
||||
|
||||
/** Represents an mmaped file. Allocated via tor_mmap_file; freed with
|
||||
* tor_munmap_file. */
|
||||
typedef struct tor_mmap_t {
|
||||
|
||||
Reference in New Issue
Block a user