|
|
|
| 1 |
|
/*** |
| 2 |
|
*sys/timeb.h - definition/declarations for _ftime() |
| 3 |
|
* |
| 4 |
|
* Copyright (c) Microsoft Corporation. All rights reserved. |
| 5 |
|
* |
| 6 |
|
*Purpose: |
| 7 |
|
* This file define the _ftime() function and the types it uses. |
| 8 |
|
* [System V] |
| 9 |
|
* |
| 10 |
|
* [Public] |
| 11 |
|
* |
| 12 |
|
****/ |
| 13 |
|
|
| 14 |
|
#if _MSC_VER > 1000 |
| 15 |
|
#pragma once |
| 16 |
|
#endif |
| 17 |
|
|
| 18 |
|
#ifndef _INC_TIMEB |
| 19 |
|
#define _INC_TIMEB |
| 20 |
|
|
| 21 |
|
#include <crtdefs.h> |
| 22 |
|
|
| 23 |
|
#if !defined(_WIN32) |
| 24 |
|
#error ERROR: Only Win32 target supported! |
| 25 |
|
#endif |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
#ifdef _MSC_VER |
| 29 |
|
#pragma pack(push,_CRT_PACKING) |
| 30 |
|
#endif /* _MSC_VER */ |
| 31 |
|
|
| 32 |
|
#ifdef __cplusplus |
| 33 |
|
extern "C" { |
| 34 |
|
#endif |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
/* Define _CRTIMP */ |
| 39 |
|
|
| 40 |
|
#ifndef _CRTIMP |
| 41 |
|
#ifdef _DLL |
| 42 |
|
#define _CRTIMP __declspec(dllimport) |
| 43 |
|
#else /* ndef _DLL */ |
| 44 |
|
#define _CRTIMP |
| 45 |
|
#endif /* _DLL */ |
| 46 |
|
#endif /* _CRTIMP */ |
| 47 |
|
|
| 48 |
|
|
| 49 |
|
/* Define __cdecl for non-Microsoft compilers */ |
| 50 |
|
|
| 51 |
|
#if ( !defined(_MSC_VER) && !defined(__cdecl) ) |
| 52 |
|
#define __cdecl |
| 53 |
|
#endif |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
#if !defined(_W64) |
| 57 |
|
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 |
| 58 |
|
#define _W64 __w64 |
| 59 |
|
#else |
| 60 |
|
#define _W64 |
| 61 |
|
#endif |
| 62 |
|
#endif |
| 63 |
|
|
| 64 |
|
#ifdef _USE_32BIT_TIME_T |
| 65 |
|
#ifdef _WIN64 |
| 66 |
|
#include <crtwrn.h> |
| 67 |
|
#pragma _CRT_WARNING( _NO_32BIT_TIME_T ) |
| 68 |
|
#undef _USE_32BIT_TIME_T |
| 69 |
|
#endif |
| 70 |
|
#endif |
| 71 |
|
|
| 72 |
|
#ifndef _TIME32_T_DEFINED |
| 73 |
|
typedef _W64 long __time32_t; /* 32-bit time value */ |
| 74 |
|
#define _TIME32_T_DEFINED |
| 75 |
|
#endif |
| 76 |
|
|
| 77 |
|
#ifndef _TIME64_T_DEFINED |
| 78 |
|
typedef __int64 __time64_t; /* 64-bit time value */ |
| 79 |
|
#define _TIME64_T_DEFINED |
| 80 |
|
#endif |
| 81 |
|
|
| 82 |
|
#ifndef _TIME_T_DEFINED |
| 83 |
|
#ifdef _USE_32BIT_TIME_T |
| 84 |
|
typedef __time32_t time_t; /* time value */ |
| 85 |
|
#else |
| 86 |
|
typedef __time64_t time_t; /* time value */ |
| 87 |
|
#endif |
| 88 |
|
#define _TIME_T_DEFINED /* avoid multiple def's of time_t */ |
| 89 |
|
#endif |
| 90 |
|
|
| 91 |
|
/* Structure returned by _ftime system call */ |
| 92 |
|
|
| 93 |
|
#ifndef _TIMEB_DEFINED |
| 94 |
|
struct __timeb32 { |
| 95 |
|
__time32_t time; |
| 96 |
|
unsigned short millitm; |
| 97 |
|
short timezone; |
| 98 |
|
short dstflag; |
| 99 |
|
}; |
| 100 |
|
|
| 101 |
|
#if !__STDC__ |
| 102 |
|
|
| 103 |
|
/* Non-ANSI name for compatibility */ |
| 104 |
|
struct timeb { |
| 105 |
|
time_t time; |
| 116 |
|
unsigned short millitm; |
| 117 |
|
short timezone; |
| 118 |
|
short dstflag; |
| 119 |
|
}; |
| 120 |
|
|
| 121 |
|
#ifdef _USE_32BIT_TIME_T |
| 122 |
|
|
| 123 |
|
#define _timeb __timeb32 |
| 124 |
|
#define _ftime _ftime32 |
| 125 |
|
#define _ftime_s _ftime32_s |
| 126 |
|
|
| 127 |
|
#else |
| 128 |
|
|
| 129 |
|
#define _timeb __timeb64 |
| 130 |
|
#define _ftime _ftime64 |
| 131 |
|
#define _ftime_s _ftime64_s |
| 132 |
|
|
| 133 |
|
#endif |
| 134 |
|
#define _TIMEB_DEFINED |
| 135 |
|
#endif |
| 136 |
|
|
| 137 |
|
#include <crtdefs.h> |
| 138 |
|
|
| 139 |
|
/* Function prototypes */ |
| 140 |
|
|
| 141 |
|
_CRT_INSECURE_DEPRECATE(_ftime32_s) _CRTIMP void __cdecl _ftime32(_Out_ struct __timeb32 * _Time); |
| 142 |
|
_CRTIMP errno_t __cdecl _ftime32_s(_Out_ struct __timeb32 * _Time); |
| 143 |
|
_CRT_INSECURE_DEPRECATE(_ftime64_s) _CRTIMP void __cdecl _ftime64(_Out_ struct __timeb64 * _Time); |
| 144 |
|
_CRTIMP errno_t __cdecl _ftime64_s(_Out_ struct __timeb64 * _Time); |
| 145 |
|
|
| 146 |
|
#if !defined(RC_INVOKED) && !defined(__midl) |
| 147 |
|
#include <sys/timeb.inl> |
| 148 |
|
#endif |
| 149 |
|
|
| 150 |
|
#ifdef __cplusplus |
| 151 |
|
} |
| 152 |
|
#endif |
| 153 |
|
|
| 154 |
|
#ifdef _MSC_VER |
| 155 |
|
#pragma pack(pop) |
| 156 |
|
#endif /* _MSC_VER */ |
| 157 |
|
|
| 158 |
|
#endif /* _INC_TIMEB */ |
| 159 |
|
|
|
|
|