QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2018 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_QUIC_PLATFORM_API_QUIC_IOVEC_H_ |
| 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_IOVEC_H_ |
| 7 | |
| 8 | #include <cstddef> |
| 9 | #include <type_traits> |
| 10 | |
| 11 | #include "net/quic/platform/impl/quic_iovec_impl.h" |
| 12 | |
| 13 | namespace quic { |
| 14 | |
| 15 | // The impl header has to export struct iovec, or a POSIX-compatible polyfill. |
| 16 | // Below, we mostly assert that what we have is appropriate. |
| 17 | static_assert(std::is_standard_layout<struct iovec>::value, |
| 18 | "iovec has to be a standard-layout struct"); |
| 19 | |
| 20 | static_assert(offsetof(struct iovec, iov_base) < sizeof(struct iovec), |
| 21 | "iovec has to have iov_base"); |
| 22 | static_assert(offsetof(struct iovec, iov_len) < sizeof(struct iovec), |
| 23 | "iovec has to have iov_len"); |
| 24 | |
| 25 | } // namespace quic |
| 26 | |
| 27 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_IOVEC_H_ |