- Remove #ifdef _WIN64 hack in favor of __MINGW_GNUC_PREREQ for pragma macros.
authorSamuel Serapion <samuel.serapion@gmail.com>
Mon, 10 Nov 2008 13:27:59 +0000 (13:27 +0000)
committerSamuel Serapion <samuel.serapion@gmail.com>
Mon, 10 Nov 2008 13:27:59 +0000 (13:27 +0000)
- Remove other hacks.
- Sync to mingw-w64 trunk.
- Prepare a bit for upcoming auto-import war (not _mingw.h)

svn path=/branches/ros-amd64-bringup/; revision=37278

14 files changed:
reactos/include/crt/_mingw.h
reactos/include/crt/assert.h
reactos/include/crt/dos.h
reactos/include/crt/fcntl.h
reactos/include/crt/io.h
reactos/include/crt/process.h
reactos/include/crt/share.h
reactos/include/crt/signal.h
reactos/include/crt/stdio.h
reactos/include/crt/stdlib.h
reactos/include/crt/sys/stat.h
reactos/include/crt/sys/types.h
reactos/include/crt/sys/utime.h
reactos/include/crt/time.h

index 7ee0877..d8e5f24 100644 (file)
 #define MINGW64_VERSION_STATE  "alpha"
 #endif
 
+#ifdef _WIN64
+#ifdef __stdcall
+#undef __stdcall
+#endif
+#define __stdcall
+#endif
+
 #ifndef __GNUC__
 # ifndef __MINGW_IMPORT
 #  define __MINGW_IMPORT  __declspec(dllimport)
@@ -46,12 +53,7 @@ limitations in handling dllimport attribute.  */
 #   define _CRTIMP
 #  endif
 # endif /* __declspec */
-# ifndef __cdecl
-#  define __cdecl __attribute__ ((__cdecl__))
-# endif
-# ifndef __stdcall
-#  define __stdcall __attribute__ ((__stdcall__))
-# endif
+#endif
 
 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
 #define __MINGW_GNUC_PREREQ(major, minor) \
@@ -125,6 +127,17 @@ limitations in handling dllimport attribute.  */
 # define __MSVCRT_VERSION__ 0x0700
 #endif
 
+#if defined(__GNUC__)
+#define __mingw_va_start(v,l) __builtin_va_start(v,l)
+#define __mingw_va_end(v) __builtin_va_end(v)
+#define __mingw_va_arg(v,l)     __builtin_va_arg(v,l)
+#define __mingw_va_copy(d,s) __builtin_va_copy(d,s)
+#elif defined(_MSC_VER)
+#define __mingw_va_start(v,l) __msc_va_start(v,l)
+#define __mingw_va_end(v) __msc_va_end(v)
+#define __mingw_va_arg(v,l)     __msc_va_arg(v,l)
+#define __mingw_va_copy(d,s) __msc_va_copy(d,s)
+#endif
 
 //#ifndef WINVER
 //#define WINVER 0x0502
@@ -158,12 +171,6 @@ typedef int __int128 __attribute__ ((mode (TI)));
 #error Only Win32 target is supported!
 #endif
 
-#if defined (__i386__)
-#define _ATTRIBUTES
-#else
-#define _ATTRIBUTES shared
-#endif
-
 #ifdef __cplusplus
 #ifndef __nothrow
 #define __nothrow __declspec(nothrow)
@@ -199,7 +206,6 @@ extern "C" {
 #define __CRT_WIDE(_String) L ## _String
 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
 #endif
-
 #ifndef _W64
 #define _W64
 #endif
@@ -393,8 +399,10 @@ extern "C" {
 
 #ifndef _TIME64_T_DEFINED
 #define _TIME64_T_DEFINED
+//#if _INTEGRAL_MAX_BITS >= 64
   typedef __int64 __time64_t;
 #endif
+//#endif
 
 #ifndef _TIME_T_DEFINED
 #define _TIME_T_DEFINED
@@ -504,4 +512,3 @@ extern "C" {
 #pragma pack(pop)
 #endif
 
-#endif
index a486eb1..6340dab 100644 (file)
@@ -28,12 +28,12 @@ __CRT_INLINE void __cdecl _Exit(int status)
 {  _exit(status); }
 #endif
 
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("abort")
 #undef abort
 #endif
   void __cdecl __declspec(noreturn) abort(void);
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma pop_macro("abort")
 #endif
 
index 8530582..294e8fe 100644 (file)
@@ -38,10 +38,10 @@ extern "C" {
   _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree);
 #endif
 
-//#if (defined(_X86_) && !defined(__x86_64))
-//  void __cdecl _disable(void);
-//  void __cdecl _enable(void);
-//#endif
+#if (defined(_X86_) && !defined(__x86_64))
+  void __cdecl _disable(void);
+  void __cdecl _enable(void);
+#endif
 
 #ifndef        NO_OLDNAMES
 #define diskfree_t _diskfree_t
index 993e21a..a231484 100644 (file)
@@ -13,8 +13,6 @@
 #define _O_RDONLY 0x0000
 #define _O_WRONLY 0x0001
 #define _O_RDWR 0x0002
-
-#define _O_ACCMODE     (_O_RDONLY|_O_WRONLY|_O_RDWR)
 #define _O_APPEND 0x0008
 #define _O_CREAT 0x0100
 #define _O_TRUNC 0x0200
@@ -24,6 +22,7 @@
 #define _O_WTEXT 0x10000
 #define _O_U16TEXT 0x20000
 #define _O_U8TEXT 0x40000
+#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
 
 #define _O_RAW _O_BINARY
 #define _O_NOINHERIT 0x0080
index 552dc47..a3c94c6 100644 (file)
@@ -388,7 +388,9 @@ extern "C" {
 
 /* Misc stuff */
 char *getlogin(void);
+#ifdef __USE_MINGW_ALARM
 unsigned int alarm(unsigned int seconds);
+#endif
 
 #ifdef __USE_MINGW_ACCESS
 /*  Old versions of MSVCRT access() just ignored X_OK, while the version
index f5ceabd..dd273ed 100644 (file)
@@ -36,12 +36,12 @@ extern "C" {
   __declspec(noreturn) void __cdecl exit(int _Code);
   _CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code);
 
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("abort")
 #undef abort
 #endif
   void __cdecl __declspec(noreturn) abort(void);
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma pop_macro("abort")
 #undef abort
 #endif
@@ -136,7 +136,17 @@ extern "C" {
 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
 
   intptr_t __cdecl cwait(int *_TermStat,intptr_t _ProcHandle,int _Action);
+#ifdef __GNUC__
+  int __cdecl execl(const char *_Filename,const char *_ArgList,...);
+  int __cdecl execle(const char *_Filename,const char *_ArgList,...);
+  int __cdecl execlp(const char *_Filename,const char *_ArgList,...);
+  int __cdecl execlpe(const char *_Filename,const char *_ArgList,...);
+#else
+    intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...);
+  intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...);
+  intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...);
   intptr_t __cdecl execlpe(const char *_Filename,const char *_ArgList,...);
+#endif
   intptr_t __cdecl spawnl(int,const char *_Filename,const char *_ArgList,...);
   intptr_t __cdecl spawnle(int,const char *_Filename,const char *_ArgList,...);
   intptr_t __cdecl spawnlp(int,const char *_Filename,const char *_ArgList,...);
@@ -147,17 +157,11 @@ extern "C" {
      stupid warnings, define them in POSIX way.  This is save, because those
      methods do not return in success case, so that the return value is not
      really dependent to its scalar width.  */
-  int __cdecl execl(const char *_Filename,const char *_ArgList,...);
-  int __cdecl execle(const char *_Filename,const char *_ArgList,...);
-  int __cdecl execlp(const char *_Filename,const char *_ArgList,...);
   int __cdecl execv(const char *_Filename,char *const _ArgList[]);
   int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]);
   int __cdecl execvp(const char *_Filename,char *const _ArgList[]);
   int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]);
 #else
-  intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...);
-  intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...);
-  intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...);
   intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]);
   intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]);
   intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]);
index 14b2772..dd7eb60 100644 (file)
@@ -18,6 +18,7 @@
 #define _SH_SECURE 0x80
 
 #ifndef        NO_OLDNAMES
+#define SH_COMPAT _SH_COMPAT
 #define SH_DENYRW _SH_DENYRW
 #define SH_DENYWR _SH_DENYWR
 #define SH_DENYRD _SH_DENYRD
index 6e9c797..a518f6b 100644 (file)
@@ -33,7 +33,9 @@ extern "C" {
 #define SIGSEGV 11
 #define        SIGSYS  12      /* bad argument to system call */
 #define        SIGPIPE 13      /* write on a pipe with no one to read it */
+#ifdef __USE_MINGW_ALARM
 #define        SIGALRM 14      /* alarm clock */
+#endif
 #define SIGTERM 15
 #define SIGBREAK 21
 #define SIGABRT2 22
index 12cbb68..efb2fff 100644 (file)
@@ -239,7 +239,7 @@ extern FILE (*_imp___iob)[];        /* A pointer to an array of FILE */
   int __cdecl vfprintf(FILE *_File,const char *_Format,va_list _ArgList);
   int __cdecl vprintf(const char *_Format,va_list _ArgList);
   /* Make sure macros are not defined.  */
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("vsnprintf")
 #pragma push_macro("snprintf")
   #undef vsnprintf
@@ -261,16 +261,23 @@ extern FILE (*_imp___iob)[];      /* A pointer to an array of FILE */
   int __cdecl sprintf(char *_Dest,const char *_Format,...);
   int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
-  int __cdecl snprintf(char* s, size_t n, const char*  format, ...);
+  __CRT_INLINE int __cdecl snprintf(char* s, size_t n, const char*  format, ...) {
+         int r;
+         va_list a;
+         __mingw_va_start(a, format);
+         r = _vsnprintf (s, n, format, a);
+         __mingw_va_end(a);
+         return r;
+  }
   __CRT_INLINE int __cdecl vsnprintf (char* s, size_t n, const char* format,va_list arg) {
     return _vsnprintf ( s, n, format, arg);
   }
-  int __cdecl vscanf(const char * Format, va_list argp);
-  int __cdecl vfscanf (FILE * fp, const char * Format,va_list argp);
-  int __cdecl vsscanf (const char * _Str,const char * Format,va_list argp);
+  int __cdecl vscanf(const char * __restrict__ Format, va_list argp);
+  int __cdecl vfscanf (FILE * __restrict__ fp, const char * Format,va_list argp);
+  int __cdecl vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp);
 #endif
 /* Restore may prior defined macros snprintf/vsnprintf.  */
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma pop_macro("snprintf")
 #pragma pop_macro("vsnprintf")
 #endif
@@ -331,7 +338,14 @@ extern FILE (*_imp___iob)[];       /* A pointer to an array of FILE */
   _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
-  int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t*  format, ...);
+  __CRT_INLINE int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t*  format, ...) {
+         int r;
+         va_list a;
+         __mingw_va_start(a, format);
+         r = _vsnwprintf (s, n, format, a);
+         __mingw_va_end(a);
+         return r;
+  }
   __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
   int __cdecl vwscanf (const wchar_t *, va_list);
   int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
index 274b841..b74bd40 100644 (file)
@@ -68,7 +68,7 @@ extern "C" {
   typedef struct {
     float f;
   } _CRT_FLOAT;
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("long")
 #undef long
 #endif
@@ -77,7 +77,7 @@ extern "C" {
     long double x;
   } _LONGDOUBLE;
 
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma pop_macro("long")
 #endif
 
@@ -313,12 +313,12 @@ extern "C" {
   __CRT_INLINE void __cdecl _Exit(int status)
   {  _exit(status); }
 #endif
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("abort")
 #undef abort
 #endif
   void __cdecl __declspec(noreturn) abort(void);
-#ifdef _WIN64 //hack for old gcc in ROSBE
+#if __MINGW_GNUC_PREREQ(4,4)
 #pragma pop_macro("abort")
 #endif
 #endif
@@ -357,7 +357,7 @@ extern "C" {
   div_t __cdecl div(int _Numerator,int _Denominator);
   char *__cdecl getenv(const char *_VarName);
   _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix);
-
+/* #if _INTEGRAL_MAX_BITS >= 64 */
   _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix);
   _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix);
   _CRTIMP __int64 __cdecl _atoi64(const char *_String);
@@ -366,7 +366,7 @@ extern "C" {
   _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
   _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
-
+/* #endif */
   ldiv_t __cdecl ldiv(long _Numerator,long _Denominator);
   _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix);
   int __cdecl mblen(const char *_Ch,size_t _MaxCount);
@@ -448,6 +448,7 @@ extern "C" {
   _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
   _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
 
+/* #if _INTEGRAL_MAX_BITS >= 64 */
   _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
   _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
   _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
@@ -456,7 +457,7 @@ extern "C" {
   _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
   _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
-
+/* #endif */
 #endif
 
 #ifndef _POSIX_
index bababc7..cc9b839 100644 (file)
@@ -115,6 +115,7 @@ extern "C" {
   };
 #endif
 
+/* #if _INTEGRAL_MAX_BITS >= 64 */
   struct _stat32i64 {
     _dev_t st_dev;
     _ino_t st_ino;
@@ -156,6 +157,7 @@ extern "C" {
     __time64_t st_mtime;
     __time64_t st_ctime;
   };
+/* #endif */
 
 #define __stat64 _stat64
 
index a09f28e..5b47492 100644 (file)
 #ifdef _USE_32BIT_TIME_T
 #ifdef _WIN64
 #undef _USE_32BIT_TIME_T
-#define _USE_64BIT_TIME_T
 #endif
 #else
 #if _INTEGRAL_MAX_BITS < 64
-#undef _USE_64BIT_TIME_T
 #define _USE_32BIT_TIME_T
 #endif
 #endif
@@ -31,8 +29,10 @@ typedef long __time32_t;
 
 #ifndef _TIME64_T_DEFINED
 #define _TIME64_T_DEFINED
+#if _INTEGRAL_MAX_BITS >= 64
 typedef __int64 __time64_t;
 #endif
+#endif
 
 #ifndef _TIME_T_DEFINED
 #define _TIME_T_DEFINED
index 4722cb9..0fbbc90 100644 (file)
@@ -71,10 +71,12 @@ extern "C" {
     __time32_t modtime;
   };
 
+#if _INTEGRAL_MAX_BITS >= 64
   struct __utimbuf64 {
     __time64_t actime;
     __time64_t modtime;
   };
+#endif
 
 #ifndef        NO_OLDNAMES
   struct utimbuf {
@@ -92,11 +94,14 @@ extern "C" {
   _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time);
   _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time);
   _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time);
+#if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time);
   _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time);
   _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
+#endif
 
 #ifndef RC_INVOKED
+#ifdef _USE_32BIT_TIME_T
 __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
   return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
 }
@@ -106,7 +111,7 @@ __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
 __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
   return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
 }
-#elif defined(_USE_64BIT_TIME_T)
+#else
 __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
   return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
 }
@@ -116,9 +121,10 @@ __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
 __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
   return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
 }
+#endif
 
 #ifndef        NO_OLDNAMES
-#ifndef _WIN64
+#ifdef _USE_32BIT_TIME_T
 __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
   return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
 }
index 6aa7d9d..5e72a78 100644 (file)
@@ -99,7 +99,7 @@ extern "C" {
 #define _ctime32     ctime
 #define _gmtime32    gmtime
 #define _mktime32    mktime
-#define _time32      _time
+#define _time32      time
 #endif
 
 #ifndef _TM_DEFINED
@@ -147,6 +147,7 @@ extern "C" {
   _CRTIMP void __cdecl _tzset(void);
 #endif
 
+#if _INTEGRAL_MAX_BITS >= 64
   double __cdecl _difftime64(__time64_t _Time1,__time64_t _Time2);
   _CRTIMP char *__cdecl _ctime64(const __time64_t *_Time);
   _CRTIMP struct tm *__cdecl _gmtime64(const __time64_t *_Time);
@@ -154,7 +155,7 @@ extern "C" {
   _CRTIMP __time64_t __cdecl _mktime64(struct tm *_Tm);
   _CRTIMP __time64_t __cdecl _mkgmtime64(struct tm *_Tm);
   _CRTIMP __time64_t __cdecl _time64(__time64_t *_Time);
-
+#endif
   unsigned __cdecl _getsystime(struct tm *_Tm);
   unsigned __cdecl _setsystime(struct tm *_Tm,unsigned _MilliSec);
 
@@ -191,7 +192,9 @@ extern "C" {
   _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale);
   _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer);
   _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer);
+#if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time);
+#endif
 
 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
 #define _INC_WTIME_INL
@@ -206,25 +209,15 @@ __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_T
 #endif
 
 #ifndef RC_INVOKED
-double __cdecl difftime(time_t _Time1,time_t _Time2);
-char *__cdecl ctime(const time_t *_Time);
-struct tm *__cdecl gmtime(const time_t *_Time);
-struct tm *__cdecl localtime(const time_t *_Time);
-struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *);
-
-time_t __cdecl mktime(struct tm *_Tm);
-time_t __cdecl _mkgmtime(struct tm *_Tm);
-time_t __cdecl time(time_t *_Time);
 
 #ifdef _USE_32BIT_TIME_T
-#if 0
 __CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); }
 __CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime32(_Time); }
 __CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime32(_Time); }
+__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime32(_Time); }
 __CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); }
 __CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime32(_Tm); }
 __CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); }
-#endif
 #else
 __CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime64(_Time1,_Time2); }
 __CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime64(_Time); }