summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quic/platform/api/quic_iovec.h
blob: 97202cd0afd5b7241ba43b61cc1c412742aa9086 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_IOVEC_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_IOVEC_H_

#include <cstddef>
#include <type_traits>

#include "net/quic/platform/impl/quic_iovec_impl.h"

namespace quic {

// The impl header has to export struct iovec, or a POSIX-compatible polyfill.
// Below, we mostly assert that what we have is appropriate.
static_assert(std::is_standard_layout<struct iovec>::value,
              "iovec has to be a standard-layout struct");

static_assert(offsetof(struct iovec, iov_base) < sizeof(struct iovec),
              "iovec has to have iov_base");
static_assert(offsetof(struct iovec, iov_len) < sizeof(struct iovec),
              "iovec has to have iov_len");

}  // namespace quic

#endif  // QUICHE_QUIC_PLATFORM_API_QUIC_IOVEC_H_