hydrogen 1.2.3
Timehelper.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#if defined(WIN32) || _DOXYGEN_
25
26#include <time.h>
27#include <sysinfoapi.h>
28
29#ifndef TIMEHELPER_H
30#define TIMEHELPER_H
31
32#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
33 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
34#else
35 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
36#endif
37
38
39#ifndef timersub
40# define timersub(a, b, result) \
41 do { \
42 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
43 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
44 if ((result)->tv_usec < 0) { \
45 --(result)->tv_sec; \
46 (result)->tv_usec += 1000000; \
47 } \
48 } while (0)
49#endif
50
51
52
53#ifndef _TIMEZONE_DEFINED /* also in sys/time.h and time.h */
54/*
55 * Maybe I should #define _TIMEZONE_DEFINED but more care is needed.
56 * It will be OK for now, if this file is included last.
57 * Investigate what else is defined/declared in the other files.
58 * Investigate the declaration of function gettimeofday below.
59 */
61{
62 int tz_minuteswest; /* minutes W of Greenwich */
63 int tz_dsttime; /* type of dst correction */
64};
65#endif /* _TIMEZONE_DEFINED */
66
67int gettimeofday(struct timeval *tv, struct timezone *tz);
68#endif
69
70#endif
int gettimeofday(struct timeval *tv, struct timezone *tz)
int tz_dsttime
Definition Timehelper.h:63
int tz_minuteswest
Definition Timehelper.h:62