OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2012 Andrey Mazo |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Robert Ammon <ammo6818@vandals.uidaho.edu> |
| 19 */ |
| 20 |
| 21 #ifndef WIN32_TIME_H |
| 22 #define WIN32_TIME_H |
| 23 |
| 24 #include <time.h> |
| 25 |
| 26 /** |
| 27 * \file |
| 28 * \ingroup core |
| 29 * Windows time definitions. |
| 30 */ |
| 31 |
| 32 /** |
| 33 * Windows declaration of timeval for use in common Unix/Windows code. |
| 34 */ |
| 35 typedef struct timeval { |
| 36 long tv_sec; |
| 37 long tv_usec; |
| 38 } timeval; |
| 39 |
| 40 /** |
| 41 * Windows declaration of struct timezone for use in common Unix/Windows code. |
| 42 */ |
| 43 struct timezone |
| 44 { |
| 45 int tz_minuteswest; /* minutes W of Greenwich */ |
| 46 int tz_dsttime; /* type of dst correction */ |
| 47 }; |
| 48 |
| 49 #ifndef _FILETIME_ |
| 50 #define _FILETIME_ |
| 51 typedef struct _FILETIME |
| 52 { |
| 53 unsigned long dwLowDateTime; |
| 54 unsigned long dwHighDateTime; |
| 55 } FILETIME; |
| 56 |
| 57 typedef struct _FILETIME *PFILETIME; |
| 58 |
| 59 typedef struct _FILETIME *LPFILETIME; |
| 60 |
| 61 #endif // !_FILETIME |
| 62 |
| 63 extern "C" { |
| 64 __declspec(dllimport) void __stdcall |
| 65 GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime); |
| 66 }; |
| 67 |
| 68 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) |
| 69 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 |
| 70 #else |
| 71 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL |
| 72 #endif |
| 73 |
| 74 /** |
| 75 * Get the time of day |
| 76 * |
| 77 * \param [in,out] tv The current time. |
| 78 * \param [out] tz Point to the timezone value |
| 79 * \returns 1 for success |
| 80 */ |
| 81 int gettimeofday(struct timeval *tv, struct timezone *tz); |
| 82 |
| 83 #endif /* WIN32_TIME_H */ |
OLD | NEW |