|
|
|
1 |
|
/*** |
2 |
|
*utime.inl - inline definitions for time handling functions |
3 |
|
* |
4 |
|
* Copyright (c) Microsoft Corporation. All rights reserved. |
5 |
|
* |
6 |
|
*Purpose: |
7 |
|
* This file contains the definition of the _utime() function. |
8 |
|
* |
9 |
|
* [Public] |
10 |
|
* |
11 |
|
****/ |
12 |
|
|
13 |
|
#if _MSC_VER > 1000 |
14 |
|
#pragma once |
15 |
|
#endif |
16 |
|
|
17 |
|
#if !defined(__CRTDECL) |
18 |
|
#if defined(_M_CEE_PURE) |
19 |
|
#define __CRTDECL |
20 |
|
#else |
21 |
|
#define __CRTDECL __cdecl |
22 |
|
#endif |
23 |
|
#endif |
24 |
|
|
25 |
|
#ifndef _INC_UTIME_INL |
26 |
|
#define _INC_UTIME_INL |
27 |
|
|
28 |
|
/* _STATIC_ASSERT is for enforcing boolean/integral conditions at compile time. |
29 |
|
Since it is purely a compile-time mechanism that generates no code, the check |
30 |
|
is left in even if _DEBUG is not defined. */ |
31 |
|
|
32 |
|
#ifndef _STATIC_ASSERT |
33 |
|
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr) ] |
34 |
|
#endif |
35 |
|
|
36 |
|
#ifdef _USE_32BIT_TIME_T |
37 |
|
static __inline int __CRTDECL _utime(const char * _Filename, struct _utimbuf * _Utimbuf) |
38 |
|
{ |
39 |
|
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf32) ); |
40 |
|
return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); |
41 |
|
} |
42 |
|
static __inline int __CRTDECL _futime(int _Desc, struct _utimbuf * _Utimbuf) |
43 |
|
{ |
44 |
|
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf32) ); |
45 |
|
return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf); |
46 |
|
} |
47 |
|
static __inline int __CRTDECL _wutime(const wchar_t * _Filename, struct _utimbuf * _Utimbuf) |
48 |
|
{ |
59 |
|
{ |
60 |
|
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf64) ); |
61 |
|
return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf); |
62 |
|
} |
63 |
|
static __inline int __CRTDECL _wutime(const wchar_t * _Filename, struct _utimbuf * _Utimbuf) |
64 |
|
{ |
65 |
|
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf64) ); |
66 |
|
return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); |
67 |
|
} |
68 |
|
#endif /* _USE_32BIT_TIME_T */ |
69 |
|
|
70 |
|
|
71 |
|
#if !__STDC__ |
72 |
|
|
73 |
|
/* Non-ANSI name for compatibility */ |
74 |
|
|
75 |
|
#ifdef _USE_32BIT_TIME_T |
76 |
|
static __inline int __CRTDECL utime(const char * _Filename, struct utimbuf * _Utimbuf) |
77 |
|
{ |
78 |
|
_STATIC_ASSERT( sizeof(struct utimbuf) == sizeof(struct __utimbuf32) ); |
79 |
|
return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); |
80 |
|
} |
81 |
|
#else |
82 |
|
static __inline int __CRTDECL utime(const char * _Filename, struct utimbuf * _Utimbuf) |
83 |
|
{ |
84 |
|
_STATIC_ASSERT( sizeof(struct utimbuf) == sizeof(struct __utimbuf64) ); |
85 |
|
return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); |
86 |
|
} |
87 |
|
#endif |
88 |
|
|
89 |
|
#endif /* !__STDC__ */ |
90 |
|
|
91 |
|
#endif |
92 |
|
|
|
|
|