Overview
| SHA1 Hash: | e1640876df7ed6fb4e84292e5ce1f78635df64ab |
|---|---|
| Date: | 2013-02-07 05:12:25 |
| User: | mistachkin |
| Comment: | Add the ability to skip defining the localtime() function when being compiled for WinCE. |
Tags And Properties
- branch=trunk inherited from [704b122e53]
- sym-trunk inherited from [704b122e53]
Changes
Changes to src/os_win.c
1617 } 1617 } 1618 } 1618 } 1619 1619 1620 #if SQLITE_OS_WINCE 1620 #if SQLITE_OS_WINCE 1621 /************************************************************************* 1621 /************************************************************************* 1622 ** This section contains code for WinCE only. 1622 ** This section contains code for WinCE only. 1623 */ 1623 */ > 1624 #if !defined(SQLITE_MSVC_LOCALTIME_API) || !SQLITE_MSVC_LOCALTIME_API 1624 /* 1625 /* 1625 ** Windows CE does not have a localtime() function. So create a | 1626 ** The MSVC CRT on Windows CE may not have a localtime() function. So 1626 ** substitute. | 1627 ** create a substitute. 1627 */ 1628 */ 1628 #include <time.h> 1629 #include <time.h> 1629 struct tm *__cdecl localtime(const time_t *t) 1630 struct tm *__cdecl localtime(const time_t *t) 1630 { 1631 { 1631 static struct tm y; 1632 static struct tm y; 1632 FILETIME uTm, lTm; 1633 FILETIME uTm, lTm; 1633 SYSTEMTIME pTm; 1634 SYSTEMTIME pTm; ................................................................................................................................................................................ 1643 y.tm_wday = pTm.wDayOfWeek; 1644 y.tm_wday = pTm.wDayOfWeek; 1644 y.tm_mday = pTm.wDay; 1645 y.tm_mday = pTm.wDay; 1645 y.tm_hour = pTm.wHour; 1646 y.tm_hour = pTm.wHour; 1646 y.tm_min = pTm.wMinute; 1647 y.tm_min = pTm.wMinute; 1647 y.tm_sec = pTm.wSecond; 1648 y.tm_sec = pTm.wSecond; 1648 return &y; 1649 return &y; 1649 } 1650 } > 1651 #endif 1650 1652 1651 #define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)] 1653 #define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)] 1652 1654 1653 /* 1655 /* 1654 ** Acquire a lock on the handle h 1656 ** Acquire a lock on the handle h 1655 */ 1657 */ 1656 static void winceMutexAcquire(HANDLE h){ 1658 static void winceMutexAcquire(HANDLE h){