e_ostime.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef OPENSSL_E_OSTIME_H
  10. # define OPENSSL_E_OSTIME_H
  11. # pragma once
  12. # include <openssl/macros.h>
  13. # include <openssl/opensslconf.h>
  14. # include <openssl/e_os2.h>
  15. /*
  16. * This header guarantees that 'struct timeval' will be available. It includes
  17. * the minimum headers needed to facilitate this. This may still be a
  18. * substantial set of headers on some platforms (e.g. <winsock2.h> on Win32).
  19. */
  20. # if defined(OPENSSL_SYS_WINDOWS)
  21. # if !defined(_WINSOCKAPI_)
  22. /*
  23. * winsock2.h defines _WINSOCK2API_ and both winsock2.h and winsock.h define
  24. * _WINSOCKAPI_. Both of these provide struct timeval. Don't include
  25. * winsock2.h if either header has been included to avoid breakage with
  26. * applications that prefer to use <winsock.h> over <winsock2.h>.
  27. */
  28. # include <winsock2.h>
  29. # endif
  30. # else
  31. # include <sys/time.h>
  32. # endif
  33. #endif