]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/winapi/include/boost/detail/winapi/time.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / winapi / include / boost / detail / winapi / time.hpp
CommitLineData
7c673cae
FG
1// time.hpp --------------------------------------------------------------//
2
3// Copyright 2010 Vicente J. Botet Escriba
4// Copyright (c) Microsoft Corporation 2014
5// Copyright 2015 Andrey Semashev
6
7// Distributed under the Boost Software License, Version 1.0.
8// See http://www.boost.org/LICENSE_1_0.txt
9
10
11#ifndef BOOST_DETAIL_WINAPI_TIME_HPP
12#define BOOST_DETAIL_WINAPI_TIME_HPP
13
14#include <boost/detail/winapi/basic_types.hpp>
15#include <boost/predef/platform.h>
16
17#ifdef BOOST_HAS_PRAGMA_ONCE
18#pragma once
19#endif
20
21#if !defined( BOOST_USE_WINDOWS_H )
22extern "C" {
23struct _FILETIME;
24struct _SYSTEMTIME;
25
26BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
27GetSystemTime(::_SYSTEMTIME* lpSystemTime);
28
29#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
30BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
31GetSystemTimeAsFileTime(::_FILETIME* lpSystemTimeAsFileTime);
32#endif
33
34BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
35SystemTimeToFileTime(
36 const ::_SYSTEMTIME* lpSystemTime,
37 ::_FILETIME* lpFileTime);
38
39BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
40FileTimeToSystemTime(
41 const ::_FILETIME* lpFileTime,
42 ::_SYSTEMTIME* lpSystemTime);
43
44#if BOOST_PLAT_WINDOWS_DESKTOP
45BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
46FileTimeToLocalFileTime(
47 const ::_FILETIME* lpFileTime,
48 ::_FILETIME* lpLocalFileTime);
49
50BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
51LocalFileTimeToFileTime(
52 const ::_FILETIME* lpLocalFileTime,
53 ::_FILETIME* lpFileTime);
54
55BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
56GetTickCount(BOOST_DETAIL_WINAPI_VOID);
57#endif
58
59#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
60BOOST_SYMBOL_IMPORT boost::detail::winapi::ULONGLONG_ WINAPI
61GetTickCount64(BOOST_DETAIL_WINAPI_VOID);
62#endif
63}
64#endif
65
66namespace boost {
67namespace detail {
68namespace winapi {
69
70typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _FILETIME {
71 DWORD_ dwLowDateTime;
72 DWORD_ dwHighDateTime;
73} FILETIME_, *PFILETIME_, *LPFILETIME_;
74
75typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEMTIME {
76 WORD_ wYear;
77 WORD_ wMonth;
78 WORD_ wDayOfWeek;
79 WORD_ wDay;
80 WORD_ wHour;
81 WORD_ wMinute;
82 WORD_ wSecond;
83 WORD_ wMilliseconds;
84} SYSTEMTIME_, *PSYSTEMTIME_, *LPSYSTEMTIME_;
85
86#if BOOST_PLAT_WINDOWS_DESKTOP
87using ::GetTickCount;
88#endif
89#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
90using ::GetTickCount64;
91#endif
92
93BOOST_FORCEINLINE VOID_ GetSystemTime(LPSYSTEMTIME_ lpSystemTime)
94{
95 ::GetSystemTime(reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
96}
97
98#if defined( BOOST_HAS_GETSYSTEMTIMEASFILETIME )
99BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(LPFILETIME_ lpSystemTimeAsFileTime)
100{
101 ::GetSystemTimeAsFileTime(reinterpret_cast< ::_FILETIME* >(lpSystemTimeAsFileTime));
102}
103#else
104// Windows CE does not define GetSystemTimeAsFileTime
105BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
106{
107 boost::detail::winapi::SYSTEMTIME_ st;
108 boost::detail::winapi::GetSystemTime(&st);
109 boost::detail::winapi::SystemTimeToFileTime(&st, lpFileTime);
110}
111#endif
112
113BOOST_FORCEINLINE BOOL_ SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime)
114{
115 return ::SystemTimeToFileTime(reinterpret_cast< const ::_SYSTEMTIME* >(lpSystemTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
116}
117
118BOOST_FORCEINLINE BOOL_ FileTimeToSystemTime(const FILETIME_* lpFileTime, SYSTEMTIME_* lpSystemTime)
119{
120 return ::FileTimeToSystemTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
121}
122
123#if BOOST_PLAT_WINDOWS_DESKTOP
124BOOST_FORCEINLINE BOOL_ FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime)
125{
126 return ::FileTimeToLocalFileTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_FILETIME* >(lpLocalFileTime));
127}
128
129BOOST_FORCEINLINE BOOL_ LocalFileTimeToFileTime(const FILETIME_* lpLocalFileTime, FILETIME_* lpFileTime)
130{
131 return ::LocalFileTimeToFileTime(reinterpret_cast< const ::_FILETIME* >(lpLocalFileTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
132}
133#endif
134
135}
136}
137}
138
139#endif // BOOST_DETAIL_WINAPI_TIME_HPP