Author: tkreuzer
Date: Sun Dec 14 17:41:51 2008
New Revision: 38088
URL:
http://svn.reactos.org/svn/reactos?rev=38088&view=rev
Log:
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
Modified:
trunk/reactos/include/crt/mbctype.h
trunk/reactos/include/crt/sec_api/time_s.h
trunk/reactos/include/crt/stdio.h
trunk/reactos/include/crt/sys/utime.h
trunk/reactos/include/crt/tchar.h
Modified: trunk/reactos/include/crt/mbctype.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mbctype.h?rev=…
==============================================================================
--- trunk/reactos/include/crt/mbctype.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mbctype.h [iso-8859-1] Sun Dec 14 17:41:51 2008
@@ -14,29 +14,16 @@
#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
Modified: trunk/reactos/include/crt/sec_api/time_s.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/sec_api/time_s…
==============================================================================
--- trunk/reactos/include/crt/sec_api/time_s.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/sec_api/time_s.h [iso-8859-1] Sun Dec 14 17:41:51 2008
@@ -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);
Modified: trunk/reactos/include/crt/stdio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/stdio.h?rev=38…
==============================================================================
--- trunk/reactos/include/crt/stdio.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/stdio.h [iso-8859-1] Sun Dec 14 17:41:51 2008
@@ -352,14 +352,14 @@
#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);
Modified: trunk/reactos/include/crt/sys/utime.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/sys/utime.h?re…
==============================================================================
--- trunk/reactos/include/crt/sys/utime.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/sys/utime.h [iso-8859-1] Sun Dec 14 17:41:51 2008
@@ -103,31 +103,32 @@
_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) {
Modified: trunk/reactos/include/crt/tchar.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/tchar.h?rev=38…
==============================================================================
--- trunk/reactos/include/crt/tchar.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/tchar.h [iso-8859-1] Sun Dec 14 17:41:51 2008
@@ -320,6 +320,13 @@
#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
@@ -653,6 +660,13 @@
#define _tutime64 _utime64
#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