[clang-format] Remove requirement that port_platform.h is at the top (#36274)

Closes #36274

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36274 from ctiller:port_platform-include-grpc-clang-format e368acfad9
PiperOrigin-RevId: 623182400
pull/36308/head
Craig Tiller 12 months ago committed by Copybara-Service
parent 83a17ff468
commit 3383b8182f
  1. 3
      include/grpc/.clang-format
  2. 3
      include/grpc/byte_buffer.h
  3. 3
      include/grpc/census.h
  4. 3
      include/grpc/compression.h
  5. 4
      include/grpc/event_engine/endpoint_config.h
  6. 3
      include/grpc/event_engine/event_engine.h
  7. 4
      include/grpc/event_engine/extensible.h
  8. 3
      include/grpc/event_engine/internal/memory_allocator_impl.h
  9. 3
      include/grpc/event_engine/memory_allocator.h
  10. 4
      include/grpc/event_engine/memory_request.h
  11. 3
      include/grpc/event_engine/slice.h
  12. 3
      include/grpc/event_engine/slice_buffer.h
  13. 3
      include/grpc/grpc.h
  14. 3
      include/grpc/grpc_audit_logging.h
  15. 3
      include/grpc/grpc_crl_provider.h
  16. 3
      include/grpc/grpc_cronet.h
  17. 3
      include/grpc/grpc_posix.h
  18. 3
      include/grpc/grpc_security.h
  19. 3
      include/grpc/impl/call.h
  20. 3
      include/grpc/impl/grpc_types.h
  21. 4
      include/grpc/impl/slice_type.h
  22. 3
      include/grpc/slice.h
  23. 3
      include/grpc/slice_buffer.h
  24. 4
      include/grpc/support/alloc.h
  25. 4
      include/grpc/support/json.h
  26. 4
      include/grpc/support/log.h
  27. 4
      include/grpc/support/metrics.h
  28. 1
      include/grpc/support/string_util.h
  29. 1
      include/grpc/support/sync.h
  30. 1
      include/grpc/support/sync_abseil.h
  31. 1
      include/grpc/support/sync_custom.h
  32. 3
      include/grpc/support/sync_generic.h
  33. 3
      include/grpc/support/sync_posix.h
  34. 4
      include/grpc/support/time.h

@ -5,9 +5,6 @@ DerivePointerAlignment: false
PointerAlignment: Left
IncludeBlocks: Regroup
IncludeCategories:
# port_platform.h is before almost everything
- Regex: '^<grpc/(support|impl/codegen)/port_platform.h>'
Priority: -100
# ruby.h is even more first if it's included
- Regex: '^<ruby/ruby.h>'
Priority: -200

@ -19,10 +19,9 @@
#ifndef GRPC_BYTE_BUFFER_H
#define GRPC_BYTE_BUFFER_H
#include <grpc/support/port_platform.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -19,9 +19,8 @@
#ifndef GRPC_CENSUS_H
#define GRPC_CENSUS_H
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -19,12 +19,11 @@
#ifndef GRPC_COMPRESSION_H
#define GRPC_COMPRESSION_H
#include <grpc/support/port_platform.h>
#include <stdlib.h>
#include <grpc/impl/compression_types.h> // IWYU pragma: export
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -14,13 +14,13 @@
#ifndef GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
#define GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
#include <grpc/support/port_platform.h>
#include <string>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {
namespace experimental {

@ -14,8 +14,6 @@
#ifndef GRPC_EVENT_ENGINE_EVENT_ENGINE_H
#define GRPC_EVENT_ENGINE_EVENT_ENGINE_H
#include <grpc/support/port_platform.h>
#include <vector>
#include "absl/functional/any_invocable.h"
@ -27,6 +25,7 @@
#include <grpc/event_engine/memory_allocator.h>
#include <grpc/event_engine/port.h>
#include <grpc/event_engine/slice_buffer.h>
#include <grpc/support/port_platform.h>
// TODO(vigneshbabu): Define the Endpoint::Write metrics collection system
namespace grpc_event_engine {

@ -15,10 +15,10 @@
#ifndef GRPC_EVENT_ENGINE_EXTENSIBLE_H
#define GRPC_EVENT_ENGINE_EXTENSIBLE_H
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {
namespace experimental {

@ -14,8 +14,6 @@
#ifndef GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
#define GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
#include <grpc/support/port_platform.h>
#include <algorithm>
#include <memory>
#include <type_traits>
@ -23,6 +21,7 @@
#include <grpc/event_engine/memory_request.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {
namespace experimental {

@ -14,8 +14,6 @@
#ifndef GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
#define GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
#include <grpc/support/port_platform.h>
#include <stdlib.h> // for abort()
#include <algorithm>
@ -25,6 +23,7 @@
#include <grpc/event_engine/internal/memory_allocator_impl.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {
namespace experimental {

@ -14,12 +14,12 @@
#ifndef GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
#define GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include "absl/strings/string_view.h"
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {
namespace experimental {

@ -15,8 +15,6 @@
#ifndef GRPC_EVENT_ENGINE_SLICE_H
#define GRPC_EVENT_ENGINE_SLICE_H
#include <grpc/support/port_platform.h>
#include <string.h>
#include <cstdint>
@ -28,6 +26,7 @@
#include <grpc/event_engine/internal/slice_cast.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
// This public slice definition largely based of the internal grpc_core::Slice
// implementation. Changes to this implementation might warrant changes to the

@ -15,8 +15,6 @@
#ifndef GRPC_EVENT_ENGINE_SLICE_BUFFER_H
#define GRPC_EVENT_ENGINE_SLICE_BUFFER_H
#include <grpc/support/port_platform.h>
#include <string.h>
#include <cstdint>
@ -31,6 +29,7 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
namespace grpc_event_engine {
namespace experimental {

@ -19,8 +19,6 @@
#ifndef GRPC_GRPC_H
#define GRPC_GRPC_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <grpc/byte_buffer.h>
@ -29,6 +27,7 @@
#include <grpc/impl/propagation_bits.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
#ifdef __cplusplus

@ -19,8 +19,6 @@
#ifndef GRPC_GRPC_AUDIT_LOGGING_H
#define GRPC_GRPC_AUDIT_LOGGING_H
#include <grpc/support/port_platform.h>
#include <memory>
#include <string>
@ -28,6 +26,7 @@
#include "absl/strings/string_view.h"
#include <grpc/support/json.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {
namespace experimental {

@ -19,8 +19,6 @@
#ifndef GRPC_GRPC_CRL_PROVIDER_H
#define GRPC_GRPC_CRL_PROVIDER_H
#include <grpc/support/port_platform.h>
#include <memory>
#include <string>
@ -28,6 +26,7 @@
#include "absl/strings/string_view.h"
#include <grpc/grpc_security.h>
#include <grpc/support/port_platform.h>
namespace grpc_core {
namespace experimental {

@ -19,9 +19,8 @@
#ifndef GRPC_GRPC_CRONET_H
#define GRPC_GRPC_CRONET_H
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -19,12 +19,11 @@
#ifndef GRPC_GRPC_POSIX_H
#define GRPC_GRPC_POSIX_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <grpc/grpc.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -19,13 +19,12 @@
#ifndef GRPC_GRPC_SECURITY_H
#define GRPC_GRPC_SECURITY_H
#include <grpc/support/port_platform.h>
#include <stdbool.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -15,11 +15,10 @@
#ifndef GRPC_IMPL_CALL_H
#define GRPC_IMPL_CALL_H
#include <grpc/support/port_platform.h>
#include "absl/functional/any_invocable.h"
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
// Run a callback in the call's EventEngine.
// Internal-only

@ -21,14 +21,13 @@
// IWYU pragma: private, include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <grpc/impl/channel_arg_names.h>
#include <grpc/impl/compression_types.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
#ifdef __cplusplus

@ -21,10 +21,10 @@
// IWYU pragma: private, include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <grpc/support/port_platform.h>
typedef struct grpc_slice grpc_slice;
/** Slice API

@ -19,9 +19,8 @@
#ifndef GRPC_SLICE_H
#define GRPC_SLICE_H
#include <grpc/support/port_platform.h>
#include <grpc/impl/slice_type.h> // IWYU pragma: export
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#ifdef __cplusplus

@ -19,9 +19,8 @@
#ifndef GRPC_SLICE_BUFFER_H
#define GRPC_SLICE_BUFFER_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {

@ -19,10 +19,10 @@
#ifndef GRPC_SUPPORT_ALLOC_H
#define GRPC_SUPPORT_ALLOC_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {
#endif

@ -17,8 +17,6 @@
#ifndef GRPC_SUPPORT_JSON_H
#define GRPC_SUPPORT_JSON_H
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <map>
@ -29,6 +27,8 @@
#include "absl/strings/str_cat.h"
#include "absl/types/variant.h"
#include <grpc/support/port_platform.h>
namespace grpc_core {
namespace experimental {

@ -19,11 +19,11 @@
#ifndef GRPC_SUPPORT_LOG_H
#define GRPC_SUPPORT_LOG_H
#include <grpc/support/port_platform.h>
#include <stdarg.h>
#include <stdlib.h> /* for abort() */
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {
#endif

@ -15,10 +15,10 @@
#ifndef GRPC_SUPPORT_METRICS_H
#define GRPC_SUPPORT_METRICS_H
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include <grpc/support/port_platform.h>
namespace grpc_core {
namespace experimental {

@ -20,7 +20,6 @@
#define GRPC_SUPPORT_STRING_UTIL_H
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
#ifdef __cplusplus

@ -21,7 +21,6 @@
/* Platform-specific type declarations of gpr_mu and gpr_cv. */
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h> /* for gpr_timespec */
#ifdef __cplusplus

@ -20,7 +20,6 @@
#define GRPC_SUPPORT_SYNC_ABSEIL_H
#include <grpc/support/port_platform.h>
#include <grpc/support/sync_generic.h>
#ifdef GPR_ABSEIL_SYNC

@ -20,7 +20,6 @@
#define GRPC_SUPPORT_SYNC_CUSTOM_H
#include <grpc/support/port_platform.h>
#include <grpc/support/sync_generic.h>
/* Users defining GPR_CUSTOM_SYNC need to define the following macros. */

@ -21,9 +21,8 @@
/* Generic type definitions for gpr_sync. */
#include <grpc/support/port_platform.h>
#include <grpc/support/atm.h>
#include <grpc/support/port_platform.h>
/* gpr_event */
typedef struct {

@ -19,10 +19,9 @@
#ifndef GRPC_SUPPORT_SYNC_POSIX_H
#define GRPC_SUPPORT_SYNC_POSIX_H
#include <grpc/support/port_platform.h>
#include <pthread.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/sync_generic.h>
#ifdef GRPC_ASAN_ENABLED

@ -19,11 +19,11 @@
#ifndef GRPC_SUPPORT_TIME_H
#define GRPC_SUPPORT_TIME_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <time.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {
#endif

Loading…
Cancel
Save