diff --git a/db/db_bench.cc b/db/db_bench.cc index f8ebf91a8..b5fa4e277 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -3609,7 +3609,8 @@ class Benchmark { if (total != prev_total) { fprintf(stderr, "RandomTransactionVerify found inconsistent totals. " - "Set[%u]: %lu, Set[%u]: %lu \n", + "Set[%" PRIu32 "]: %" PRIu64 ", Set[%" PRIu32 "]: %" PRIu64 + " \n", i - 1, prev_total, i, total); abort(); } @@ -3617,7 +3618,8 @@ class Benchmark { prev_total = total; } - fprintf(stdout, "RandomTransactionVerify Success! Total:%lu\n", prev_total); + fprintf(stdout, "RandomTransactionVerify Success! Total:%" PRIu64 "\n", + prev_total); } void Compact(ThreadState* thread) { diff --git a/utilities/transactions/optimistic_transaction_impl.cc b/utilities/transactions/optimistic_transaction_impl.cc index 0571e83d9..cfb9fa660 100644 --- a/utilities/transactions/optimistic_transaction_impl.cc +++ b/utilities/transactions/optimistic_transaction_impl.cc @@ -7,6 +7,11 @@ #include "utilities/transactions/optimistic_transaction_impl.h" +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + +#include #include #include @@ -304,9 +309,9 @@ Status OptimisticTransactionImpl::CheckTransactionForConflicts(DB* db) { char msg[255]; snprintf( msg, sizeof(msg), - "Could not commit transaction with write at SequenceNumber %lu " - "as the MemTable only contains changes newer than SequenceNumber " - "%lu.", + "Could not commit transaction with write at SequenceNumber %" PRIu64 + " as the MemTable only contains changes newer than SequenceNumber " + "%" PRIu64 ".", key_seq, earliest_seq); result = Status::Busy(msg); } else {