diff options
author | Carl Worth <cworth@cworth.org> | 2010-02-09 11:09:30 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-02-09 11:14:16 -0800 |
commit | e0a8dee8bcf0785325c07fff5a11e8ec494826db (patch) | |
tree | ba4339c6a1a9191e1e52351bacbc210a2df8c13c /lib/database-private.h | |
parent | 9439b217c349478b3603d5368f534acb1cd23974 (diff) |
Fix printf for when uint64_t != unsigned long long int
Thanks to Michal Sojka <sojkam1@fel.cvut.cz> for pointing out the
correct fix, which I verified in the freely-available WG14/N1124 draft
(from the C99 working group) which is available here:
http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf
Diffstat (limited to 'lib/database-private.h')
-rw-r--r-- | lib/database-private.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/database-private.h b/lib/database-private.h index 5bb6e86c..41918d76 100644 --- a/lib/database-private.h +++ b/lib/database-private.h @@ -21,6 +21,15 @@ #ifndef NOTMUCH_DATABASE_PRIVATE_H #define NOTMUCH_DATABASE_PRIVATE_H +/* According to WG14/N1124, a C++ implementation won't provide us a + * macro like PRIx64 (which gives a printf format string for + * formatting a uint64_t as hexadecimal) unless we define + * __STDC_FORMAT_MACROS before including inttypes.h. That's annoying, + * but there it is. + */ +#define __STDC_FORMAT_MACROS +#include <inttypes.h> + #include "notmuch-private.h" #include <xapian.h> |