1/*
2 * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OPENSSL_E_OSTIME_H
11# define OPENSSL_E_OSTIME_H
12# pragma once
13
14# include <openssl/macros.h>
15# include <openssl/opensslconf.h>
16# include <openssl/e_os2.h>
17
18/*
19 * This header guarantees that 'struct timeval' will be available. It includes
20 * the minimum headers needed to facilitate this. This may still be a
21 * substantial set of headers on some platforms (e.g. <winsock2.h> on Win32).
22 */
23
24# if defined(OPENSSL_SYS_WINDOWS)
25# if !defined(_WINSOCKAPI_)
26 /*
27 * winsock2.h defines _WINSOCK2API_ and both winsock2.h and winsock.h define
28 * _WINSOCKAPI_. Both of these provide struct timeval. Don't include
29 * winsock2.h if either header has been included to avoid breakage with
30 * applications that prefer to use <winsock.h> over <winsock2.h>.
31 */
32# include <winsock2.h>
33# endif
34# else
35# include <sys/time.h>
36# endif
37
38#endif
39