-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
220 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/*** | ||
*sys/utime.h - definitions/declarations for utime() | ||
* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* | ||
*Purpose: | ||
* This file defines the structure used by the utime routine to set | ||
* new file access and modification times. NOTE - MS-DOS | ||
* does not recognize access time, so this field will | ||
* always be ignored and the modification time field will be | ||
* used to set the new time. | ||
* | ||
* [Public] | ||
* | ||
****/ | ||
|
||
#if _MSC_VER > 1000 | ||
#pragma once | ||
#endif | ||
|
||
#ifndef _INC_UTIME | ||
#define _INC_UTIME | ||
|
||
#if !defined(_WIN32) | ||
#error ERROR: Only Win32 target supported! | ||
#endif | ||
|
||
#include <crtdefs.h> | ||
|
||
|
||
#ifdef _MSC_VER | ||
#pragma pack(push,_CRT_PACKING) | ||
#endif /* _MSC_VER */ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Define _CRTIMP */ | ||
|
||
#ifndef _CRTIMP | ||
#ifdef _DLL | ||
#define _CRTIMP __declspec(dllimport) | ||
#else /* ndef _DLL */ | ||
#define _CRTIMP | ||
#endif /* _DLL */ | ||
#endif /* _CRTIMP */ | ||
|
||
|
||
/* define struct used by _utime() function */ | ||
|
||
#ifndef _UTIMBUF_DEFINED | ||
|
||
struct _utimbuf { | ||
time_t actime; /* access time */ | ||
time_t modtime; /* modification time */ | ||
}; | ||
|
||
struct __utimbuf32 { | ||
__time32_t actime; /* access time */ | ||
__time32_t modtime; /* modification time */ | ||
}; | ||
|
||
#if _INTEGRAL_MAX_BITS >= 64 | ||
struct __utimbuf64 { | ||
__time64_t actime; /* access time */ | ||
__time64_t modtime; /* modification time */ | ||
}; | ||
#endif | ||
|
||
#if !__STDC__ | ||
/* Non-ANSI name for compatibility */ | ||
struct utimbuf { | ||
time_t actime; /* access time */ | ||
time_t modtime; /* modification time */ | ||
}; | ||
|
||
struct utimbuf32 { | ||
__time32_t actime; /* access time */ | ||
__time32_t modtime; /* modification time */ | ||
}; | ||
|
||
#endif /* !__STDC__ */ | ||
|
||
#define _UTIMBUF_DEFINED | ||
#endif | ||
|
||
|
||
/* Function Prototypes */ | ||
|
||
_CRTIMP int __cdecl _utime32(__in_z const char * _Filename, __in_opt struct __utimbuf32 * _Time); | ||
|
||
_CRTIMP int __cdecl _futime32(__in int _FileDes, __in_opt struct __utimbuf32 * _Time); | ||
|
||
/* Wide Function Prototypes */ | ||
_CRTIMP int __cdecl _wutime32(__in_z const wchar_t * _Filename, __in_opt struct __utimbuf32 * _Time); | ||
|
||
#if _INTEGRAL_MAX_BITS >= 64 | ||
_CRTIMP int __cdecl _utime64(__in_z const char * _Filename, __in_opt struct __utimbuf64 * _Time); | ||
_CRTIMP int __cdecl _futime64(__in int _FileDes, __in_opt struct __utimbuf64 * _Time); | ||
_CRTIMP int __cdecl _wutime64(__in_z const wchar_t * _Filename, __in_opt struct __utimbuf64 * _Time); | ||
#endif | ||
|
||
|
||
#if !defined(RC_INVOKED) && !defined(__midl) | ||
#include <sys/utime.inl> | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#ifdef _MSC_VER | ||
#pragma pack(pop) | ||
#endif /* _MSC_VER */ | ||
|
||
#endif /* _INC_UTIME */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/*** | ||
*utime.inl - inline definitions for time handling functions | ||
* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* | ||
*Purpose: | ||
* This file contains the definition of the _utime() function. | ||
* | ||
* [Public] | ||
* | ||
****/ | ||
|
||
#pragma once | ||
|
||
#if !defined(__CRTDECL) | ||
#if defined(_M_CEE_PURE) | ||
#define __CRTDECL | ||
#else | ||
#define __CRTDECL __cdecl | ||
#endif | ||
#endif | ||
|
||
#ifndef _INC_UTIME_INL | ||
#define _INC_UTIME_INL | ||
|
||
/* _STATIC_ASSERT is for enforcing boolean/integral conditions at compile time. | ||
Since it is purely a compile-time mechanism that generates no code, the check | ||
is left in even if _DEBUG is not defined. */ | ||
|
||
#ifndef _STATIC_ASSERT | ||
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr) ] | ||
#endif | ||
|
||
#ifdef _USE_32BIT_TIME_T | ||
static __inline int __CRTDECL _utime(const char * _Filename, struct _utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf32) ); | ||
return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); | ||
} | ||
static __inline int __CRTDECL _futime(int _Desc, struct _utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf32) ); | ||
return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf); | ||
} | ||
static __inline int __CRTDECL _wutime(const wchar_t * _Filename, struct _utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf32) ); | ||
return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf); | ||
} | ||
#else | ||
static __inline int __CRTDECL _utime(const char * _Filename, struct _utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf64) ); | ||
return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); | ||
} | ||
static __inline int __CRTDECL _futime(int _Desc, struct _utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf64) ); | ||
return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf); | ||
} | ||
static __inline int __CRTDECL _wutime(const wchar_t * _Filename, struct _utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct _utimbuf) == sizeof(struct __utimbuf64) ); | ||
return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); | ||
} | ||
#endif /* _USE_32BIT_TIME_T */ | ||
|
||
|
||
#if !__STDC__ | ||
|
||
/* Non-ANSI name for compatibility */ | ||
|
||
#ifdef _USE_32BIT_TIME_T | ||
static __inline int __CRTDECL utime(const char * _Filename, struct utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct utimbuf) == sizeof(struct __utimbuf32) ); | ||
return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); | ||
} | ||
#else | ||
static __inline int __CRTDECL utime(const char * _Filename, struct utimbuf * _Utimbuf) | ||
{ | ||
_STATIC_ASSERT( sizeof(struct utimbuf) == sizeof(struct __utimbuf64) ); | ||
return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); | ||
} | ||
#endif | ||
|
||
#endif /* !__STDC__ */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ EXPORTS | |
_wenviron=msvcrt._wenviron | ||
snprintf=msvcrt.snprintf | ||
vsnprintf=msvcrt.vsnprintf | ||
_ftelli64=msvcrt._ftelli64 |