mbctype.h: fix broken _mbctype[] and _mbcasemap[] declarations

sec_api/time_s.h: add asctime_s
stdio.h: comment out defines for non-conforming swprintfs
sys/utime.h: fix definition of _utime / _utime32 to be compatible to msvc while linking to msvcrt.dll
tchar.h: add secure time functions
fixes msvcrt_winetest

svn path=/trunk/; revision=38088
This commit is contained in:
Timo Kreuzer 2008-12-14 23:41:51 +00:00
parent 2f3c5f280b
commit e9d55d0638
5 changed files with 54 additions and 51 deletions

View file

@ -14,29 +14,16 @@ extern "C" {
#endif
/* CRT stuff */
#if 1
#if defined (_DLL) && defined (_M_IX86)
#if defined(_M_CEE_PURE)
/* Retained for compatibility with VC++ 5.0 and earlier versions */
_CRTIMP unsigned char * __cdecl __p__mbctype(void);
_CRTIMP unsigned char * __cdecl __p__mbcasemap(void);
#endif /* defined (_DLL) && defined (_M_IX86) */
#endif
#ifndef _mbctype
#ifdef _MSVCRT_
extern unsigned char _mbctype[257];
#define _mbctype (__p__mbctype())
#define _mbcasemap (__p__mbcasemap())
#else
#define _mbctype (*_imp___mbctype)
extern unsigned char **_imp___mbctype;
#endif
#endif
#ifndef _mbcasemap
#ifdef _MSVCRT_
extern unsigned char *_mbcasemap;
#else
#define _mbcasemap (*_imp___mbcasemap)
extern unsigned char **_imp___mbcasemap;
#endif
#endif
_CRTIMP extern unsigned char _mbctype[];
_CRTIMP extern unsigned char _mbcasemap[];
#endif // defined(_M_CEE_PURE)
/* CRT stuff */
#if 1

View file

@ -14,6 +14,7 @@
extern "C" {
#endif
_CRTIMP errno_t __cdecl asctime_s(char *_Buf,size_t _SizeInWords,const struct tm *_Tm);
_CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time);
_CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time);
_CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time);

View file

@ -352,14 +352,14 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#include <vadefs.h>
#endif
#ifdef _CRT_NON_CONFORMING_SWPRINTFS
#ifndef __cplusplus
#define swprintf _swprintf
#define vswprintf _vswprintf
#define _swprintf_l __swprintf_l
#define _vswprintf_l __vswprintf_l
#endif
#endif
//#ifdef _CRT_NON_CONFORMING_SWPRINTFS
//#ifndef __cplusplus
//#define swprintf _swprintf
//#define vswprintf _vswprintf
//#define _swprintf_l __swprintf_l
//#define _vswprintf_l __vswprintf_l
//#endif
//#endif
_CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
_CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList);

View file

@ -103,31 +103,32 @@ extern "C" {
_CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
#endif
#if 0
// Do it like this to keep compatibility to MSVC while using msvcrt.dll
#ifndef RC_INVOKED
#ifdef _USE_32BIT_TIME_T
__CRT_INLINE int __cdecl _utime32(const char *_Filename,struct _utimbuf *_Utimbuf) {
return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
}
__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf);
}
__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
}
#else
__CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
}
__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf);
}
__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
}
#endif
#endif
#endif
#ifdef _USE_32BIT_TIME_T
__CRT_INLINE int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Utimbuf) {
return _utime(_Filename,(struct __timbuf *)_Utimbuf);
}
__CRT_INLINE int __cdecl _futime32(int _Desc,struct __utimbuf32 *_Utimbuf) {
return _futime(_Desc,(struct _utimbuf *)_Utimbuf);
}
__CRT_INLINE int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Utimbuf) {
return _wutime(_Filename,(struct _utimbuf *)_Utimbuf);
}
#else // !_USE_32BIT_TIME_T
#ifndef _WIN64
__CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
}
__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf);
}
__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
}
#endif
#endif // _USE_32BIT_TIME_T
#endif // RC_INVOKED
#ifndef NO_OLDNAMES
__CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {

View file

@ -320,6 +320,13 @@ extern "C" {
#define _tcsftime wcsftime
#define _tcsftime_l _wcsftime_l
#define _tasctime_s _wasctime_s
#define _tctime_s _wctime_s
#define _tctime32_s _wctime32_s
#define _tctime64_s _wctime64_s
#define _tstrdate_s _wstrdate_s
#define _tstrtime_s _wstrtime_s
#define _tchdir _wchdir
#define _tgetcwd _wgetcwd
#define _tgetdcwd _wgetdcwd
@ -654,6 +661,13 @@ extern "C" {
#define _tcsftime strftime
#define _tcsftime_l _strftime_l
#define _tasctime_s asctime_s
#define _tctime_s ctime_s
#define _tctime32_s _ctime32_s
#define _tctime64_s _ctime64_s
#define _tstrdate_s _strdate_s
#define _tstrtime_s _strtime_s
#define _tchdir _chdir
#define _tgetcwd _getcwd
#define _tgetdcwd _getdcwd