]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/time.cpp
handle NULL BSTRs as empty ones per Microsoft convention
[wxWidgets.git] / src / msw / wince / time.cpp
index 587d4a7964bc18b4d6993c68fe54f23b9f99d578..6e6915b819b2a3d2bed9ec50448f2ef3b1848b0a 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        src/msw/wince/time.cpp
 // Purpose:     Implements missing time functionality for WinCE
 // Author:      Marco Cavallini (MCK) - wx@koansoftware.com
-// Modified by:
+// Modified by: Vadim Zeitlin for VC8 support
 // Created:     31-08-2003
 // RCS-ID:      $Id$
 // Copyright:   (c) Marco Cavallini
 
 #include "wx/msw/wince/time.h"
 
+#if defined(__VISUALC__) && (__VISUALC__ >= 1400)
+
+// VC8 does provide the time functions but not the standard ones
+#include <altcecrt.h>
+
+time_t __cdecl time(time_t *t)
+{
+    __time64_t t64;
+    if ( !_time64(&t64) )
+        return (time_t)-1;
+
+    if ( t )
+        *t = (time_t)t64;
+
+    return (time_t)t64;
+}
+
+time_t __cdecl mktime(struct tm *t)
+{
+    return (time_t)_mktime64(t);
+}
+
+#else // !VC8
+
 /////////////////////////////////////////////////////////////////////////////////////////////
 //                                                                                         //
 //                             strftime() - taken from OpenBSD                             //
@@ -499,7 +523,6 @@ extern "C"
 
 /* Not needed in VS Studio 2005 */
 
-#if !(__VISUALC__ >= 1400)
 size_t wcsftime(wchar_t *s,
                 const size_t maxsize,
                 const wchar_t *format,
@@ -516,7 +539,6 @@ size_t wcsftime(wchar_t *s,
 
     return sz;
 }
-#endif
 
 } /* extern "C" */
 
@@ -737,4 +759,4 @@ time_t __cdecl mktime(struct tm *t)
 
 } // extern "C"
 
-
+#endif // VC8/!VC8