msvcTime.h 1.7 KB
Newer Older
1
/*****************************************************************************\
S
Shengliang Guan 已提交
2 3 4 5 6 7 8 9 10 11 12
*                                                                             *
*   Filename:	    time.h						      *
*                                                                             *
*   Description:    MsvcLibX extensions to time.h.			      *
*                                                                             *
*   Notes:	    							      *
*                                                                             *
*   History:								      *
*    2014-06-04 JFL Created this file.                                        *
*    2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT.
*									      *
13
*        Copyright 2016 Hewlett Packard Enterprise Development LP          *
S
Shengliang Guan 已提交
14 15 16 17 18 19 20 21
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/

#ifndef	_MSVCLIBX_TIME_H
#define	_MSVCLIBX_TIME_H	1

#include "msvclibx.h"

S
TD-1057  
Shengliang Guan 已提交
22 23
#include <winsock2.h>
#include <time.h> /* Include MSVC's own <time.h> file */
S
Shengliang Guan 已提交
24 25 26 27 28 29 30 31 32 33 34 35


#ifdef _MSDOS

/* Check for the definition of _STRUCT_TIMESPEC before using clock_gettime().
   If it's not defined, use time() instead, which is supported by all OSs. */

#endif /* defined(_MSDOS) */


#ifdef _WIN32

S
TD-1057  
Shengliang Guan 已提交
36
#include "sys\msvcTime.h" /* for struct timespec */
S
Shengliang Guan 已提交
37 38 39 40

typedef int clockid_t;
/* Supported values for clockid_t */
#define CLOCK_REALTIME 0
41
#define CLOCK_MONOTONIC 1
S
Shengliang Guan 已提交
42 43 44 45 46 47 48

int clock_gettime(clockid_t clock_id, struct timespec *tp);

#endif /* defined(_WIN32) */

#endif /* defined(_MSVCLIBX_TIME_H)  */