1 // Copyright 2022 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CLIENT_STATS_IMPL_H_
6 #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CLIENT_STATS_IMPL_H_
7 
8 #include <string>
9 
10 namespace quiche {
11 
12 // Use namespace qualifier in case the macro is used outside the quiche
13 // namespace.
14 
15 #define QUICHE_CLIENT_HISTOGRAM_ENUM_IMPL(name, sample, enum_size, docstring) \
16   do {                                                                        \
17     quiche::QuicheClientSparseHistogramImpl(name, static_cast<int>(sample));  \
18   } while (0)
19 
20 #define QUICHE_CLIENT_HISTOGRAM_BOOL_IMPL(name, sample, docstring) \
21   do {                                                             \
22     (void)sample; /* Workaround for -Wunused-variable. */          \
23   } while (0)
24 
25 #define QUICHE_CLIENT_HISTOGRAM_TIMES_IMPL(name, sample, min, max, \
26                                            num_buckets, docstring) \
27   do {                                                             \
28     (void)sample; /* Workaround for -Wunused-variable. */          \
29   } while (0)
30 
31 #define QUICHE_CLIENT_HISTOGRAM_COUNTS_IMPL(name, sample, min, max, \
32                                             num_buckets, docstring) \
33   do {                                                              \
34     quiche::QuicheClientSparseHistogramImpl(name, sample);          \
35   } while (0)
36 
QuicheClientSparseHistogramImpl(const std::string &,int)37 inline void QuicheClientSparseHistogramImpl(const std::string& /*name*/,
38                                             int /*sample*/) {
39   // No-op.
40 }
41 
42 }  // namespace quiche
43 
44 #endif  // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CLIENT_STATS_IMPL_H_
45