diff options
author | David Goulet <dgoulet@torproject.org> | 2023-06-19 18:32:44 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-06-19 18:32:44 +0000 |
commit | 8286d88ed012789c56a6cab5c7c5f5c7625b4bc1 (patch) | |
tree | b8156f3a0b53e6c76ed1dfe2570cd763c9c855ef /src | |
parent | 3cb6a690be60fcdab60130402ff88dcfc0657596 (diff) | |
parent | 45ee8a10e292510a22b37a2adac1426cfe339350 (diff) | |
download | tor-8286d88ed012789c56a6cab5c7c5f5c7625b4bc1.tar.gz tor-8286d88ed012789c56a6cab5c7c5f5c7625b4bc1.zip |
Merge branch 'ticket40773' into 'main'
Fix compilation error on older gcc versions and MSVC.
See merge request tpo/core/tor!717
Diffstat (limited to 'src')
-rw-r--r-- | src/feature/hs/hs_metrics_entry.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/feature/hs/hs_metrics_entry.c b/src/feature/hs/hs_metrics_entry.c index 2268ba4c59..d862d0adec 100644 --- a/src/feature/hs/hs_metrics_entry.c +++ b/src/feature/hs/hs_metrics_entry.c @@ -28,8 +28,16 @@ static const int64_t hs_metrics_circ_build_time_buckets[] = 60000 /* 60s */ }; -static const size_t hs_metrics_circ_build_time_buckets_size = - ARRAY_LENGTH(hs_metrics_circ_build_time_buckets); +// TODO: Define a constant for ARRAY_LENGTH(hs_metrics_circ_build_time_buckets) +// and use where it applicable. +// +// This is commented out because it doesn't compile with gcc versions < 8.1 +// or with MSVC ("initializer element is not constant"). +// +// See ticket#40773 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69960#c18 +// +/*static const size_t hs_metrics_circ_build_time_buckets_size =*/ +/*ARRAY_LENGTH(hs_metrics_circ_build_time_buckets);*/ /** The base metrics that is a static array of metrics that are added to every * single new stores. @@ -93,7 +101,7 @@ const hs_metrics_entry_t base_metrics[] = .type = METRICS_TYPE_HISTOGRAM, .name = METRICS_NAME(hs_intro_circ_build_time), .buckets = hs_metrics_circ_build_time_buckets, - .bucket_count = hs_metrics_circ_build_time_buckets_size, + .bucket_count = ARRAY_LENGTH(hs_metrics_circ_build_time_buckets), .help = "The introduction circuit build time in milliseconds", }, { @@ -101,7 +109,7 @@ const hs_metrics_entry_t base_metrics[] = .type = METRICS_TYPE_HISTOGRAM, .name = METRICS_NAME(hs_rend_circ_build_time), .buckets = hs_metrics_circ_build_time_buckets, - .bucket_count = hs_metrics_circ_build_time_buckets_size, + .bucket_count = ARRAY_LENGTH(hs_metrics_circ_build_time_buckets), .help = "The rendezvous circuit build time in milliseconds", }, { |