summaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-08-21 06:56:44 +0000
committerHeikki Linnakangas2014-08-21 06:56:44 +0000
commitce486056ecd28050f367894a2b5aad3656d37511 (patch)
tree338a69224ad29e0532658f4a5580211338778f83 /src/include/c.h
parentfa069822f5a02bbbe46bada0b6e420a89c5f7484 (diff)
Add #define INT64_MODIFIER for the printf length modifier for 64-bit ints.
We have had INT64_FORMAT and UINT64_FORMAT for a long time, but that's not good enough if you want something more exotic, like "%20lld". Abhijit Menon-Sen, per Andres Freund's suggestion.
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h
index a48a57a42b3..2ceaaf6c1d7 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -288,6 +288,9 @@ typedef unsigned long long int uint64;
#define UINT64CONST(x) ((uint64) x)
#endif
+/* snprintf format strings to use for 64-bit integers */
+#define INT64_FORMAT "%" INT64_MODIFIER "d"
+#define UINT64_FORMAT "%" INT64_MODIFIER "u"
/* Select timestamp representation (float8 or int64) */
#ifdef USE_INTEGER_DATETIMES