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_COMMON_PLATFORM_API_QUICHE_IOVEC_H_ 6 #define QUICHE_COMMON_PLATFORM_API_QUICHE_IOVEC_H_ 7 8 #include <cstddef> 9 #include <type_traits> 10 11 #include "quiche_platform_impl/quiche_iovec_impl.h" 12 13 // The impl header has to export struct iovec, or a POSIX-compatible polyfill. 14 // Below, we mostly assert that what we have is appropriate. 15 static_assert(std::is_standard_layout<struct iovec>::value, 16 "iovec has to be a standard-layout struct"); 17 18 static_assert(offsetof(struct iovec, iov_base) < sizeof(struct iovec), 19 "iovec has to have iov_base"); 20 static_assert(offsetof(struct iovec, iov_len) < sizeof(struct iovec), 21 "iovec has to have iov_len"); 22 23 #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_IOVEC_H_ 24