Only show user-presets in favorite sidebar
[ardour.git] / msvc_extra_headers / ardourext / sys / time.h.input
1 #ifndef _WINX_SYS_TIME_H_
2 #define _WINX_SYS_TIME_H_
3
4 #define WIN32_LEAN_AND_MEAN          /* This line found to be needed by JE - 18-08-2013. Line was formerly. . . #include <features.h> */
5 #ifndef __suseconds_t_defined        /* This section added by JE - 22-08-2013 */
6 #define __suseconds_t_defined
7 typedef long          __suseconds_t;
8 typedef __suseconds_t   suseconds_t;
9 #endif
10 #if !defined(BUILDING_EVORAL) && !defined(BUILDING_QMDSP) && !defined(BUILDING_VAMPPLUGINS)
11 #include <WinSock2.h> /* gets 'struct timeval' - Changed by JE - 23-07-2013. Was formerly. . . #include <WinSock.h> */
12 /* For whatever reason, Ardour's 'libevoral' refuses to build as a DLL if we include both 'rpc.h' */
13 /* and 'WinSock2.h'. It doesn't seem to matter which order we #include them. Given that we can't  */
14 /* edit 'rpc.h' or 'WinSock2.h', just make sure we don't #include them when building libevoral.   */
15
16 /* Type of the second argument to `getitimer' and
17    the second and third arguments `setitimer'.  */
18 struct itimerval
19   {
20     /* Value to put into `it_value' when the timer expires.  */
21     struct timeval it_interval;
22     /* Time to the next timer expiration.  */
23     struct timeval it_value;
24   };
25 #endif
26
27 #ifdef _TIMEVAL_DEFINED
28 # define _STRUCT_TIMEVAL     1
29 #endif /* _TIMEVAL_DEFINED */
30 //#include <bits/types.h>
31 #define __need_time_t
32 #include <time.h>
33 #define __need_timeval
34 //#include <bits/time.h>
35
36 #ifdef _TIMEVAL_DEFINED /* also in winsock[2].h */
37 # undef __TIMEVAL__
38 # define __TIMEVAL__ 1
39 # undef _STRUCT_TIMEVAL
40 # define _STRUCT_TIMEVAL     1
41 #endif /* _TIMEVAL_DEFINED */
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 #ifdef __USE_GNU
48 /* Macros for converting between `struct timeval' and `struct timespec'.  */
49 # define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
50         (ts)->tv_sec = (tv)->tv_sec;                                    \
51         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
52 }
53 # define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
54         (tv)->tv_sec = (ts)->tv_sec;                                    \
55         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
56 }
57 #endif
58
59 #ifdef __USE_BSD
60 /* Structure crudely representing a timezone.
61    This is obsolete and should never be used.  */
62 struct timezone
63   {
64     int tz_minuteswest;       /* Minutes west of GMT.  */
65     int tz_dsttime;      /* Nonzero if DST is ever in effect.  */
66   };
67
68 typedef struct timezone *__restrict __timezone_ptr_t;
69 #else
70 typedef void *__restrict __timezone_ptr_t;
71 #endif
72
73 /* Get the current time of day and timezone information,
74    putting it into *TV and *TZ.  If TZ is NULL, *TZ is not filled.
75    Returns 0 on success, -1 on errors.
76    NOTE: This form of timezone information is obsolete.
77    Use the functions and variables declared in <time.h> instead.  */
78 #ifdef LIBPBD_DLL /* JE - use the version that's available from libpbd */
79 #ifdef LIBPBD_API
80 LIBPBD_API int __cdecl gettimeofday (struct timeval *__restrict __tv,
81                 __timezone_ptr_t __tz) __THROW;
82 #else
83 __declspec(dllimport) int __cdecl gettimeofday (struct timeval *__restrict __tv,
84                 __timezone_ptr_t __tz) __THROW;
85 #endif
86 #else
87 extern int gettimeofday (struct timeval *__restrict __tv,
88                 __timezone_ptr_t __tz) __THROW;
89 #endif
90 extern int getntptimeofday (struct timespec *__restrict __tp,
91                 __timezone_ptr_t __tz) __THROW;
92
93 #ifdef __USE_BSD
94 /* Set the current time of day and timezone information.
95    This call is restricted to the super-user.  */
96 extern int settimeofday (__const struct timeval *__tv,
97                 __const struct timezone *__tz) __THROW;
98 extern int setntptimeofday (__const struct timespec *__tp,
99                 __const struct timezone *__tz) __THROW;
100 #endif
101
102 ///* Values for the first argument to `getitimer' and `setitimer'.  */
103 //enum __itimer_which
104 //  {
105 //    /* Timers run in real time.  */
106 //    ITIMER_REAL = 0,
107 //#define ITIMER_REAL ITIMER_REAL
108 //    /* Timers run only when the process is executing.  */
109 //    ITIMER_VIRTUAL = 1,
110 //#define ITIMER_VIRTUAL ITIMER_VIRTUAL
111 //    /* Timers run when the process is executing and when
112 //       the system is executing on behalf of the process.  */
113 //    ITIMER_PROF = 2
114 //#define ITIMER_PROF ITIMER_PROF
115 //  };
116
117 #if defined __USE_GNU && !defined __cplusplus
118 /* Use the nicer parameter type only in GNU mode and not for C++ since the
119    strict C++ rules prevent the automatic promotion.  */
120 typedef enum __itimer_which __itimer_which_t;
121 #else
122 typedef int __itimer_which_t;
123 #endif
124
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif /*_WINX_SYS_TIMEX_H_*/