~steve-sk2/mingw-w64/oneiric

« back to all changes in this revision

Viewing changes to mingw-w64-headers/crt/sys/time.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-11-18 00:04:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101118000446-xe24b423su55onyl
Tags: 1.0+20101003-1
* New maintainer. (Closes: #594371.)
* New upstream snapshot:
  - Includes getopt.h. (Closes: #569914.)
* Build g++ for Win64. (Closes: #600451.)
* Standards-Version 3.9.1 (new packaging).
* Include patch from
  http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64?view=revision&revision=3715
  as suggested by Rafaël Carré.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * This file has no copyright assigned and is placed in the Public Domain.
3
 
 * This file is part of the w64 mingw-runtime package.
4
 
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
 
 */
6
 
 
7
 
#ifndef _SYS_TIME_H_
8
 
#define _SYS_TIME_H_
9
 
 
10
 
#include <time.h>
11
 
 
12
 
#ifdef  __cplusplus
13
 
extern "C" {
14
 
#endif
15
 
 
16
 
#ifndef __STRICT_ANSI__
17
 
#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
18
 
#define _TIMEVAL_DEFINED
19
 
struct timeval {
20
 
  long tv_sec;
21
 
  long tv_usec;
22
 
};
23
 
#define timerisset(tvp)  ((tvp)->tv_sec || (tvp)->tv_usec)
24
 
#define timercmp(tvp, uvp, cmp) \
25
 
  (((tvp)->tv_sec != (uvp)->tv_sec) ? \
26
 
  ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
27
 
  ((tvp)->tv_usec cmp (uvp)->tv_usec))
28
 
#define timerclear(tvp)  (tvp)->tv_sec = (tvp)->tv_usec = 0
29
 
#endif /* _TIMEVAL_DEFINED */
30
 
 
31
 
#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
32
 
#define _TIMEZONE_DEFINED
33
 
/* Provided for compatibility with code that assumes that
34
 
   the presence of gettimeofday function implies a definition
35
 
   of struct timezone. */
36
 
struct timezone
37
 
{
38
 
  int tz_minuteswest; /* of Greenwich */
39
 
  int tz_dsttime;     /* type of dst correction to apply */
40
 
};
41
 
 
42
 
  extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z);
43
 
 
44
 
#endif
45
 
 
46
 
/*
47
 
   Implementation as per:
48
 
   The Open Group Base Specifications, Issue 6
49
 
   IEEE Std 1003.1, 2004 Edition
50
 
 
51
 
   The timezone pointer arg is ignored.  Errors are ignored.
52
 
*/
53
 
#ifndef _GETTIMEOFDAY_DEFINED
54
 
#define _GETTIMEOFDAY_DEFINED
55
 
int __cdecl gettimeofday(struct timeval *__restrict__,
56
 
                         void *__restrict__  /* tzp (unused) */);
57
 
#endif
58
 
 
59
 
#endif /* __STRICT_ANSI__ */
60
 
 
61
 
#ifdef  __cplusplus
62
 
}
63
 
#endif
64
 
 
65
 
/* Adding timespec definition.  */
66
 
#include <sys/timeb.h>
67
 
 
68
 
 
69
 
#endif /* _SYS_TIME_H_ */