File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
#pragma once
2
2
3
+ #include < bit>
3
4
#include < cassert>
4
5
#include < iomanip>
5
6
#include < iostream>
6
7
#include < string>
7
8
#include < vector>
8
- #include " absl/numeric/bits.h"
9
9
#include < binlog/binlog.hpp>
10
10
#include < cmath>
11
11
#include < charconv>
@@ -52,7 +52,7 @@ class UntypedTrapLabel {
52
52
size_t strSize () const {
53
53
if (id_ == 0 ) return 2 ; // #0
54
54
// Number of hex digits is ceil(bit_width(id) / 4), but C++ integer division can only do floor.
55
- return /* # */ 1 + /* hex digits */ 1 + (absl ::bit_width (id_) - 1 ) / 4 ;
55
+ return /* # */ 1 + /* hex digits */ 1 + (std ::bit_width (id_) - 1 ) / 4 ;
56
56
}
57
57
58
58
friend bool operator !=(UntypedTrapLabel lhs, UntypedTrapLabel rhs) { return lhs.id_ != rhs.id_ ; }
Original file line number Diff line number Diff line change 55
55
#define DIAGNOSE_CRITICAL (ID, ...) DIAGNOSE_WITH_LEVEL(critical, ID, __VA_ARGS__)
56
56
57
57
#define CODEQL_DIAGNOSTIC_LOG_FORMAT_PREFIX " [{}] "
58
- // TODO(C++20) replace non-standard , ##__VA_ARGS__ with __VA_OPT__(,) __VA_ARGS__
59
58
#define DIAGNOSE_WITH_LEVEL (LEVEL, ID, FORMAT, ...) \
60
59
do { \
61
60
auto _now = ::binlog::clockNow (); \
62
61
const ::codeql::SwiftDiagnostic& _id = ID; \
63
62
::codeql::Log::diagnose (_id, std::chrono::nanoseconds{_now}, \
64
- fmt::format (FORMAT, ## __VA_ARGS__)); \
63
+ fmt::format (FORMAT __VA_OPT__ (, ) __VA_ARGS__)); \
65
64
LOG_WITH_LEVEL_AND_TIME (LEVEL, _now, CODEQL_DIAGNOSTIC_LOG_FORMAT_PREFIX FORMAT, \
66
- _id.abbreviation(), ## __VA_ARGS__); \
65
+ _id.abbreviation() __VA_OPT__(, ) __VA_ARGS__); \
67
66
} while (false )
68
67
69
68
// avoid calling into binlog's original macros
You can’t perform that action at this time.
0 commit comments