6
6
// Must not be included from any .h files to avoid polluting the namespace
7
7
// with macros.
8
8
9
+ #define __STDC_FORMAT_MACROS
10
+ #include < inttypes.h>
9
11
#include < stdio.h>
10
12
#include < string>
11
13
#include < algorithm>
@@ -50,13 +52,13 @@ void DumpDBFileSummary(const DBOptions& options, const std::string& dbname) {
50
52
break ;
51
53
case kDescriptorFile :
52
54
env->GetFileSize (dbname + " /" + file, &file_size);
53
- Log (options.info_log , " MANIFEST file: %s size: %lu Bytes\n " ,
55
+ Log (options.info_log , " MANIFEST file: %s size: %" PRIu64 " Bytes\n " ,
54
56
file.c_str (), file_size);
55
57
break ;
56
58
case kLogFile :
57
59
env->GetFileSize (dbname + " /" + file, &file_size);
58
60
char str[8 ];
59
- snprintf (str, sizeof (str), " %lu " , file_size);
61
+ snprintf (str, sizeof (str), " %" PRIu64 , file_size);
60
62
wal_info.append (file).append (" size: " ).
61
63
append (str, sizeof (str)).append (" ;" );
62
64
break ;
@@ -87,7 +89,7 @@ void DumpDBFileSummary(const DBOptions& options, const std::string& dbname) {
87
89
}
88
90
}
89
91
}
90
- Log (options.info_log , " SST files in %s dir, Total Num: %lu , files: %s\n " ,
92
+ Log (options.info_log , " SST files in %s dir, Total Num: %" PRIu64 " , files: %s\n " ,
91
93
db_path.path .c_str (), file_num, file_info.c_str ());
92
94
file_num = 0 ;
93
95
file_info.clear ();
@@ -106,7 +108,7 @@ void DumpDBFileSummary(const DBOptions& options, const std::string& dbname) {
106
108
if (type == kLogFile ) {
107
109
env->GetFileSize (options.wal_dir + " /" + file, &file_size);
108
110
char str[8 ];
109
- snprintf (str, sizeof (str), " %lu " , file_size);
111
+ snprintf (str, sizeof (str), " %" PRIu64 , file_size);
110
112
wal_info.append (file).append (" size: " ).
111
113
append (str, sizeof (str)).append (" ;" );
112
114
}
0 commit comments