utime.h 3.3 KB

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