[xxhash] add a wrapper header to avoid clang-format breakage (#34658)

pull/34479/head
Mark D. Roth 1 year ago committed by GitHub
parent d9033b36e2
commit f15635287b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Package.swift
  2. 1
      build_autogenerated.yaml
  3. 2
      gRPC-C++.podspec
  4. 2
      gRPC-Core.podspec
  5. 1
      grpc.gemspec
  6. 1
      package.xml
  7. 12
      src/core/BUILD
  8. 4
      src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
  9. 11
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  10. 29
      src/core/lib/gprpp/xxhash_inline.h
  11. 7
      test/core/client_channel/lb_policy/ring_hash_test.cc
  12. 1
      tools/doxygen/Doxyfile.c++.internal
  13. 1
      tools/doxygen/Doxyfile.core.internal

1
Package.swift generated

@ -1273,6 +1273,7 @@ let package = Package(
"src/core/lib/gprpp/windows/thd.cc",
"src/core/lib/gprpp/work_serializer.cc",
"src/core/lib/gprpp/work_serializer.h",
"src/core/lib/gprpp/xxhash_inline.h",
"src/core/lib/handshaker/proxy_mapper.h",
"src/core/lib/handshaker/proxy_mapper_registry.cc",
"src/core/lib/handshaker/proxy_mapper_registry.h",

@ -770,6 +770,7 @@ libs:
- src/core/lib/gprpp/unique_type_name.h
- src/core/lib/gprpp/validation_errors.h
- src/core/lib/gprpp/work_serializer.h
- src/core/lib/gprpp/xxhash_inline.h
- src/core/lib/handshaker/proxy_mapper.h
- src/core/lib/handshaker/proxy_mapper_registry.h
- src/core/lib/http/format_request.h

2
gRPC-C++.podspec generated

@ -867,6 +867,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/handshaker/proxy_mapper.h',
'src/core/lib/handshaker/proxy_mapper_registry.h',
'src/core/lib/http/format_request.h',
@ -1937,6 +1938,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/handshaker/proxy_mapper.h',
'src/core/lib/handshaker/proxy_mapper_registry.h',
'src/core/lib/http/format_request.h',

2
gRPC-Core.podspec generated

@ -1376,6 +1376,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/windows/thd.cc',
'src/core/lib/gprpp/work_serializer.cc',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/handshaker/proxy_mapper.h',
'src/core/lib/handshaker/proxy_mapper_registry.cc',
'src/core/lib/handshaker/proxy_mapper_registry.h',
@ -2692,6 +2693,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/handshaker/proxy_mapper.h',
'src/core/lib/handshaker/proxy_mapper_registry.h',
'src/core/lib/http/format_request.h',

1
grpc.gemspec generated

@ -1279,6 +1279,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/windows/thd.cc )
s.files += %w( src/core/lib/gprpp/work_serializer.cc )
s.files += %w( src/core/lib/gprpp/work_serializer.h )
s.files += %w( src/core/lib/gprpp/xxhash_inline.h )
s.files += %w( src/core/lib/handshaker/proxy_mapper.h )
s.files += %w( src/core/lib/handshaker/proxy_mapper_registry.cc )
s.files += %w( src/core/lib/handshaker/proxy_mapper_registry.h )

1
package.xml generated

@ -1261,6 +1261,7 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/windows/thd.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/work_serializer.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/work_serializer.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/xxhash_inline.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/handshaker/proxy_mapper.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/handshaker/proxy_mapper_registry.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/handshaker/proxy_mapper_registry.h" role="src" />

@ -4864,6 +4864,14 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "xxhash_inline",
hdrs = ["lib/gprpp/xxhash_inline.h"],
external_deps = ["xxhash"],
language = "c++",
deps = ["//:gpr_platform"],
)
grpc_cc_library(
name = "grpc_lb_policy_ring_hash",
srcs = [
@ -4879,7 +4887,6 @@ grpc_cc_library(
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
"xxhash",
],
language = "c++",
deps = [
@ -4900,6 +4907,7 @@ grpc_cc_library(
"resolved_address",
"unique_type_name",
"validation_errors",
"xxhash_inline",
"//:channel_arg_names",
"//:config",
"//:debug_location",
@ -5536,7 +5544,6 @@ grpc_cc_library(
"absl/types:optional",
"absl/types:variant",
"re2",
"xxhash",
],
language = "c++",
deps = [
@ -5557,6 +5564,7 @@ grpc_cc_library(
"ref_counted",
"slice",
"time",
"xxhash_inline",
"//:channel_arg_names",
"//:config",
"//:debug_location",

@ -37,9 +37,6 @@
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#define XXH_INLINE_ALL
#include "xxhash.h"
#include <grpc/impl/channel_arg_names.h>
#include <grpc/impl/connectivity_state.h>
#include <grpc/support/json.h>
@ -58,6 +55,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/gprpp/work_serializer.h"
#include "src/core/lib/gprpp/xxhash_inline.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"

@ -16,6 +16,8 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
#include <stdint.h>
#include <string.h>
@ -44,12 +46,6 @@
#include "re2/re2.h"
#include <grpc/impl/channel_arg_names.h>
#include "src/core/lib/slice/slice.h"
#define XXH_INLINE_ALL
#include "xxhash.h"
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
@ -57,7 +53,6 @@
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h"
#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
#include "src/core/ext/xds/xds_bootstrap.h"
#include "src/core/ext/xds/xds_bootstrap_grpc.h"
#include "src/core/ext/xds/xds_client_grpc.h"
@ -82,6 +77,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/work_serializer.h"
#include "src/core/lib/gprpp/xxhash_inline.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/promise/arena_promise.h"
@ -92,6 +88,7 @@
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/service_config/service_config.h"
#include "src/core/lib/service_config/service_config_impl.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/lib/uri/uri_parser.h"

@ -0,0 +1,29 @@
//
// Copyright 2023 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_SRC_CORE_LIB_GPRPP_XXHASH_INLINE_H
#define GRPC_SRC_CORE_LIB_GPRPP_XXHASH_INLINE_H
#include <grpc/support/port_platform.h>
// This header is a simple wrapper around the third-party xxhash
// library, so that we don't need to define XXH_INLINE_ALL in every file
// that includes xxhash.h. That definition confuses clang-format's
// ordering of includes.
#define XXH_INLINE_ALL
#include "xxhash.h"
#endif // GRPC_SRC_CORE_LIB_GPRPP_XXHASH_INLINE_H

@ -14,6 +14,8 @@
// limitations under the License.
//
#include "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h"
#include <stdint.h>
#include <algorithm>
@ -29,14 +31,11 @@
#include "absl/types/optional.h"
#include "gtest/gtest.h"
#define XXH_INLINE_ALL
#include "xxhash.h"
#include <grpc/grpc.h>
#include <grpc/support/json.h>
#include "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/xxhash_inline.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/load_balancing/lb_policy.h"
#include "src/core/lib/resolver/endpoint_addresses.h"

@ -2277,6 +2277,7 @@ src/core/lib/gprpp/windows/stat.cc \
src/core/lib/gprpp/windows/thd.cc \
src/core/lib/gprpp/work_serializer.cc \
src/core/lib/gprpp/work_serializer.h \
src/core/lib/gprpp/xxhash_inline.h \
src/core/lib/handshaker/proxy_mapper.h \
src/core/lib/handshaker/proxy_mapper_registry.cc \
src/core/lib/handshaker/proxy_mapper_registry.h \

@ -2056,6 +2056,7 @@ src/core/lib/gprpp/windows/stat.cc \
src/core/lib/gprpp/windows/thd.cc \
src/core/lib/gprpp/work_serializer.cc \
src/core/lib/gprpp/work_serializer.h \
src/core/lib/gprpp/xxhash_inline.h \
src/core/lib/handshaker/proxy_mapper.h \
src/core/lib/handshaker/proxy_mapper_registry.cc \
src/core/lib/handshaker/proxy_mapper_registry.h \

Loading…
Cancel
Save