Add crt versions of ctime, gmtime, mktime, time, localtime, _mkgmtime, and difftime. git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@77 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/ChangeLog b/mingw-w64-crt/ChangeLog index 0da71db..c6298d4 100755 --- a/mingw-w64-crt/ChangeLog +++ b/mingw-w64-crt/ChangeLog
@@ -2,6 +2,9 @@ * dirent.c: (_topendir): Let d_name point to dd_dta.name. PR/1801043 + * mktime.c, difftime.c, ctime.c, gmtime.c, localtime.c, + _mkgmtime.c, time.c: New files in misc. + * Makefile: Add new files to build. 2007-09-21 Kai Tietz <kai.tietz@onevision.com>
diff --git a/mingw-w64-crt/Makefile b/mingw-w64-crt/Makefile index 83da1bb..4668c06 100755 --- a/mingw-w64-crt/Makefile +++ b/mingw-w64-crt/Makefile
@@ -192,7 +192,8 @@ wmemchr.o wmemcmp.o wmemcpy.o wmemmove.o wmemset.o \ wctrans.o wctype.o wcrtomb.o wctob.o mbrtowc.o btowc.o seterrno.o \ sleep.o alarm.o getlogin.o gettimeofday.o wassert.o isblank.o iswblank.o \ - wininterlocked.o + wininterlocked.o mktime.o difftime.o ctime.o gmtime.o localtime.o _mkgmtime.o \ + time.o STDLIB_OBJS = \ strtold.o wcstold.o
diff --git a/mingw-w64-crt/misc/_mkgmtime.c b/mingw-w64-crt/misc/_mkgmtime.c new file mode 100755 index 0000000..42077b0 --- /dev/null +++ b/mingw-w64-crt/misc/_mkgmtime.c
@@ -0,0 +1,10 @@ +#include <time.h> + +time_t __cdecl _mkgmtime(struct tm *_Tm) +{ +#ifdef _USE_32BIT_TIME_T + return _mkgmtime32(_Tm); +#else + return _mkgmtime64(_Tm); +#endif +}
diff --git a/mingw-w64-crt/misc/ctime.c b/mingw-w64-crt/misc/ctime.c new file mode 100755 index 0000000..a7edcf6 --- /dev/null +++ b/mingw-w64-crt/misc/ctime.c
@@ -0,0 +1,10 @@ +#include <time.h> + +char *__cdecl ctime(const time_t *_Time) +{ +#ifdef _USE_32BIT_TIME_T + return _ctime32(_Time); +#else + return _ctime64(_Time); +#endif +} \ No newline at end of file
diff --git a/mingw-w64-crt/misc/difftime.c b/mingw-w64-crt/misc/difftime.c new file mode 100755 index 0000000..991ad4c --- /dev/null +++ b/mingw-w64-crt/misc/difftime.c
@@ -0,0 +1,10 @@ +#include <time.h> + +double __cdecl difftime(time_t _Time1,time_t _Time2) +{ +#ifdef _USE_32BIT_TIME_T + return _difftime32(_Time1,_Time2); +#else + return _difftime64(_Time1,_Time2); +#endif +} \ No newline at end of file
diff --git a/mingw-w64-crt/misc/gmtime.c b/mingw-w64-crt/misc/gmtime.c new file mode 100755 index 0000000..56d0abc --- /dev/null +++ b/mingw-w64-crt/misc/gmtime.c
@@ -0,0 +1,10 @@ +#include <time.h> + +struct tm *__cdecl gmtime(const time_t *_Time) +{ +#ifdef _USE_32BIT_TIME_T + return _gmtime32(_Time); +#else + return _gmtime64(_Time); +#endif +}
diff --git a/mingw-w64-crt/misc/localtime.c b/mingw-w64-crt/misc/localtime.c new file mode 100755 index 0000000..411f0b8 --- /dev/null +++ b/mingw-w64-crt/misc/localtime.c
@@ -0,0 +1,10 @@ +#include <time.h> + +struct tm *__cdecl localtime(const time_t *_Time) +{ +#ifdef _USE_32BIT_TIME_T + return _localtime32(_Time); +#else + return _localtime64(_Time); +#endif +}
diff --git a/mingw-w64-crt/misc/mktime.c b/mingw-w64-crt/misc/mktime.c new file mode 100755 index 0000000..e333603 --- /dev/null +++ b/mingw-w64-crt/misc/mktime.c
@@ -0,0 +1,10 @@ +#include <time.h> + +time_t __cdecl mktime(struct tm *_Tm) +{ +#ifdef _USE_32BIT_TIME_T + return _mktime32(_Tm); +#else + return _mktime64(_Tm); +#endif +} \ No newline at end of file
diff --git a/mingw-w64-crt/misc/time.c b/mingw-w64-crt/misc/time.c new file mode 100755 index 0000000..192c551 --- /dev/null +++ b/mingw-w64-crt/misc/time.c
@@ -0,0 +1,10 @@ +#include <time.h> + +time_t __cdecl time(time_t *_Time) +{ +#ifdef _USE_32BIT_TIME_T + return _time32(_Time); +#else + return _time64(_Time); +#endif +}