1 //  time.hpp  --------------------------------------------------------------//
2 
3 //  Copyright 2010 Vicente J. Botet Escriba
4 
5 //  Distributed under the Boost Software License, Version 1.0.
6 //  See http://www.boost.org/LICENSE_1_0.txt
7 
8 
9 #ifndef BOOST_DETAIL_WIN_TIME_HPP
10 #define BOOST_DETAIL_WIN_TIME_HPP
11 
12 #include <boost/detail/win/basic_types.hpp>
13 
14 
15 namespace boost {
16 namespace detail {
17 namespace win32 {
18 #if defined( BOOST_USE_WINDOWS_H )
19     typedef FILETIME FILETIME_;
20     typedef PFILETIME PFILETIME_;
21     typedef LPFILETIME LPFILETIME_;
22 
23     typedef SYSTEMTIME SYSTEMTIME_;
24     typedef SYSTEMTIME* PSYSTEMTIME_;
25 
26     #ifndef UNDER_CE  // Windows CE does not define GetSystemTimeAsFileTime
27     using ::GetSystemTimeAsFileTime;
28     #endif
29     using ::FileTimeToLocalFileTime;
30     using ::GetSystemTime;
31     using ::SystemTimeToFileTime;
32     using ::GetTickCount;
33 
34 #else
35 extern "C" {
36     typedef struct _FILETIME {
37         DWORD_ dwLowDateTime;
38         DWORD_ dwHighDateTime;
39     } FILETIME_, *PFILETIME_, *LPFILETIME_;
40 
41     typedef struct _SYSTEMTIME {
42       WORD_ wYear;
43       WORD_ wMonth;
44       WORD_ wDayOfWeek;
45       WORD_ wDay;
46       WORD_ wHour;
47       WORD_ wMinute;
48       WORD_ wSecond;
49       WORD_ wMilliseconds;
50     } SYSTEMTIME_, *PSYSTEMTIME_;
51 
52     #ifndef UNDER_CE  // Windows CE does not define GetSystemTimeAsFileTime
53     __declspec(dllimport) void WINAPI
54         GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
55     #endif
56     __declspec(dllimport) int WINAPI
57         FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
58                 FILETIME_* lpLocalFileTime);
59     __declspec(dllimport) void WINAPI
60         GetSystemTime(SYSTEMTIME_* lpSystemTime);
61     __declspec(dllimport) int WINAPI
62         SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime,
63                 FILETIME_* lpFileTime);
64     __declspec(dllimport) unsigned long __stdcall
65         GetTickCount();
66 }
67 #endif
68 }
69 }
70 }
71 
72 #endif // BOOST_DETAIL_WIN_TIME_HPP
73