| 1 | /** |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. |
| 3 | * This file is part of the mingw-w64 runtime package. |
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 | */ |
| 6 | #ifndef _INC_UTIME |
| 7 | #define _INC_UTIME |
| 8 | |
| 9 | #ifndef _WIN32 |
| 10 | #error Only Win32 target is supported! |
| 11 | #endif |
| 12 | |
| 13 | #include <crtdefs.h> |
| 14 | |
| 15 | #pragma pack(push,_CRT_PACKING) |
| 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | #ifndef _CRTIMP |
| 22 | #define _CRTIMP __declspec(dllimport) |
| 23 | #endif |
| 24 | |
| 25 | #ifndef _WCHAR_T_DEFINED |
| 26 | typedef unsigned short wchar_t; |
| 27 | #define _WCHAR_T_DEFINED |
| 28 | #endif |
| 29 | |
| 30 | #ifdef _USE_32BIT_TIME_T |
| 31 | #ifdef _WIN64 |
| 32 | #undef _USE_32BIT_TIME_T |
| 33 | #endif |
| 34 | #endif |
| 35 | |
| 36 | #ifndef _TIME32_T_DEFINED |
| 37 | #define _TIME32_T_DEFINED |
| 38 | typedef long __time32_t; |
| 39 | #endif |
| 40 | |
| 41 | #ifndef _TIME64_T_DEFINED |
| 42 | #define _TIME64_T_DEFINED |
| 43 | __MINGW_EXTENSION typedef __int64 __time64_t; |
| 44 | #endif |
| 45 | |
| 46 | #ifndef _TIME_T_DEFINED |
| 47 | #define _TIME_T_DEFINED |
| 48 | #ifdef _USE_32BIT_TIME_T |
| 49 | typedef __time32_t time_t; |
| 50 | #else |
| 51 | typedef __time64_t time_t; |
| 52 | #endif |
| 53 | #endif |
| 54 | |
| 55 | #ifndef _UTIMBUF_DEFINED |
| 56 | #define _UTIMBUF_DEFINED |
| 57 | |
| 58 | struct _utimbuf { |
| 59 | time_t actime; |
| 60 | time_t modtime; |
| 61 | }; |
| 62 | |
| 63 | struct __utimbuf32 { |
| 64 | __time32_t actime; |
| 65 | __time32_t modtime; |
| 66 | }; |
| 67 | |
| 68 | struct __utimbuf64 { |
| 69 | __time64_t actime; |
| 70 | __time64_t modtime; |
| 71 | }; |
| 72 | |
| 73 | #ifndef	NO_OLDNAMES |
| 74 | struct utimbuf { |
| 75 | time_t actime; |
| 76 | time_t modtime; |
| 77 | }; |
| 78 | |
| 79 | struct utimbuf32 { |
| 80 | __time32_t actime; |
| 81 | __time32_t modtime; |
| 82 | }; |
| 83 | #endif |
| 84 | #endif |
| 85 | |
| 86 | _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time); |
| 87 | _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time); |
| 88 | _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time); |
| 89 | _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time); |
| 90 | _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time); |
| 91 | _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time); |
| 92 | |
| 93 | #ifndef RC_INVOKED |
| 94 | |
| 95 | /* |
| 96 | * To prevent ABI issues, the mingw-w64 runtime should not call these |
| 97 | * functions. Instead it should call the fixed-size variants. |
| 98 | */ |
| 99 | #ifndef _CRTBLD |
| 100 | #ifdef _USE_32BIT_TIME_T |
| 101 | int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) __MINGW_ASM_CALL(_utime32); |
| 102 | int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) __MINGW_ASM_CALL(_futime32); |
| 103 | int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) __MINGW_ASM_CALL(_wutime32); |
| 104 | #else |
| 105 | int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) __MINGW_ASM_CALL(_utime64); |
| 106 | int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) __MINGW_ASM_CALL(_futime64); |
| 107 | int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) __MINGW_ASM_CALL(_wutime64); |
| 108 | #endif |
| 109 | #ifndef	NO_OLDNAMES |
| 110 | #ifdef _USE_32BIT_TIME_T |
| 111 | int __cdecl utime(const char *, struct utimbuf *) __MINGW_ASM_CALL(_utime32); |
| 112 | #else |
| 113 | int __cdecl utime(const char *, struct utimbuf *) __MINGW_ASM_CALL(_utime64); |
| 114 | #endif |
| 115 | #endif |
| 116 | #endif /* _CRTBLD */ |
| 117 | |
| 118 | #endif |
| 119 | |
| 120 | #ifdef __cplusplus |
| 121 | } |
| 122 | #endif |
| 123 | |
| 124 | #pragma pack(pop) |
| 125 | #endif |