From 2feb85d96505e7a500e26fa41dffcdfbc6a003c6 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 3 Mar 2022 02:46:16 +0100 Subject: [PATCH] Ugrade to version 45 --- CHANGES.md | 6 ++ setenv.bat | 2 +- tools/README.md | 2 +- tools/cmsc15_makedist.bat | 2 +- tools/cmsc15_versions.bat | 4 +- tools/include/crt/sys/utime.h | 119 ++++++++++++++++++++++++++++++++ tools/include/crt/sys/utime.inl | 89 ++++++++++++++++++++++++ tools/msvcrt_compat.def | 1 + 8 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 tools/include/crt/sys/utime.h create mode 100644 tools/include/crt/sys/utime.inl diff --git a/CHANGES.md b/CHANGES.md index 986a0d0..6c8fc68 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,12 @@ For a full list of changes, see the [git commit log][log] [log]: https://github.com/mturk/cmsc/commits/ +## cmsc 15.0_45 + + * Add missing _ftelli64 + * Fix faulty sys/utime.h + * Update cygwrun dependency + ## cmsc 15.0_44 * Update cygwrun dependency diff --git a/setenv.bat b/setenv.bat index 90fd632..536f469 100644 --- a/setenv.bat +++ b/setenv.bat @@ -26,7 +26,7 @@ if not exist "%CmscRootDir%\msvc\bin\build.exe" ( exit /B 1 ) set "WINVER=0x0601" -set "CMSC_VERSION=15044" +set "CMSC_VERSION=15045" rem rem Default target is 64-bit Windows rem diff --git a/tools/README.md b/tools/README.md index 5f4cd22..45baa83 100644 --- a/tools/README.md +++ b/tools/README.md @@ -2,7 +2,7 @@ ``` -curl.exe 7.81.0 https://curl.se/windows/dl-7.80.0/curl-7.81.0-win64-mingw.zip +curl.exe 7.81.0 https://curl.se/windows/dl-7.81.0_1/curl-7.81.0_1-win64-mingw.zip 7za.exe 21.07 https://www.7-zip.org/a/7z2107-extra.7z patch.exe 2.5.9 http://gnuwin32.sourceforge.net ``` diff --git a/tools/cmsc15_makedist.bat b/tools/cmsc15_makedist.bat index 46a6f75..06c1e2b 100644 --- a/tools/cmsc15_makedist.bat +++ b/tools/cmsc15_makedist.bat @@ -42,7 +42,7 @@ rem Create distribution .zip rem 7za a -bd cmsc-%CmscVer%-%CmscArch%.zip %CmscDist% set "PATH=%CmscDist%\perl\perl\bin;%PATH%" -call shasum.bat -a 512 cmsc-%CmscVer%-%CmscArch%.zip > cmsc-%CmscVer%-%CmscArch%.sha512 +call shasum.bat -a 256 cmsc-%CmscVer%-%CmscArch%.zip > cmsc-%CmscVer%-%CmscArch%.sha256 rem popd echo. diff --git a/tools/cmsc15_versions.bat b/tools/cmsc15_versions.bat index 850935d..1410727 100644 --- a/tools/cmsc15_versions.bat +++ b/tools/cmsc15_versions.bat @@ -14,12 +14,12 @@ rem limitations under the License. rem rem Setup environment for Microsoft Compiler Toolkit rem -set "CmscVer=15.0_44" +set "CmscVer=15.0_45" set "CmscSys=64" set "CmscOsv=win7" set "NasmVer=2.15.05" set "PerlVer=5.32.1.1" -set "CygwrunVer=1.0.7" +set "CygwrunVer=1.0.8" set "TclVer=8.6.12" set "CurlOpts=-qkL --retry 5 --no-progress-meter" set "WINVER=0x0601" diff --git a/tools/include/crt/sys/utime.h b/tools/include/crt/sys/utime.h new file mode 100644 index 0000000..52ca658 --- /dev/null +++ b/tools/include/crt/sys/utime.h @@ -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 + + +#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 +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_UTIME */ + + diff --git a/tools/include/crt/sys/utime.inl b/tools/include/crt/sys/utime.inl new file mode 100644 index 0000000..db8e41a --- /dev/null +++ b/tools/include/crt/sys/utime.inl @@ -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 diff --git a/tools/msvcrt_compat.def b/tools/msvcrt_compat.def index 9a2f52d..a839416 100644 --- a/tools/msvcrt_compat.def +++ b/tools/msvcrt_compat.def @@ -7,3 +7,4 @@ EXPORTS _wenviron=msvcrt._wenviron snprintf=msvcrt.snprintf vsnprintf=msvcrt.vsnprintf + _ftelli64=msvcrt._ftelli64