b=490037; export localtime_r/gmtime_r from CE shunt; r=dougt
authorVladimir Vukicevic <vladimir@pobox.com>
Fri, 24 Apr 2009 12:55:12 -0700
changeset 27813 4be56d2fd8c9e1015c70d4c7572ce6105b3879fb
parent 27812 e6675b1c79a8e166dd89b4f5cdf8de0c1bdd87db
child 27814 8f2a1bc10ff65e727ca8e99d411270c7d99d710f
push id6725
push uservladimir@mozilla.com
push dateFri, 24 Apr 2009 19:56:46 +0000
treeherderautoland@4be56d2fd8c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs490037
milestone1.9.2a1pre
b=490037; export localtime_r/gmtime_r from CE shunt; r=dougt
build/wince/shunt/include/mozce_shunt.h
build/wince/shunt/time.cpp
configure.in
--- a/build/wince/shunt/include/mozce_shunt.h
+++ b/build/wince/shunt/include/mozce_shunt.h
@@ -138,17 +138,27 @@ int _unlink(const char *filename );
  struct tm* localtime(const time_t* inTimeT)
  struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
  struct tm* gmtime(const time_t* inTimeT)
  time_t mktime(struct tm* inTM)
  time_t time(time_t *)
  clock_t clock() 
   
 */
-  
+
+struct tm;
+
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
+#endif
+
+struct tm* gmtime_r(const time_t* inTimeT, struct tm* outRetval);
+struct tm* localtime_r(const time_t* inTimeT, struct tm* outRetval);
+
 /* Locale Stuff */
   
 /* The locale stuff should be defined here, but it can't be because it
    is already defined in locale.h.
   
  struct lconv * localeconv(void)
   
 */
--- a/build/wince/shunt/time.cpp
+++ b/build/wince/shunt/time.cpp
@@ -75,17 +75,17 @@ static const int sDaysOfYear[12] = {
 };
 static struct tm tmStorage;
 
 size_t strftime(char *, size_t, const char *, const struct tm *)
 {
   return 0;
 }
 
-static struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
+struct tm* gmtime_r(const time_t* inTimeT, struct tm* outRetval)
 {
   struct tm* retval = NULL;
   
   if(NULL != inTimeT) {
     SYSTEMTIME winGMTime;
     
     time_t_2_SYSTEMTIME(winGMTime, *inTimeT);
     
@@ -110,17 +110,17 @@ static struct tm* mozce_gmtime_r(const t
         }
       }
     }
     retval = outRetval;
   }
   return retval;
 }
 
-static struct tm* mozce_localtime_r(const time_t* inTimeT,struct tm* outRetval)
+struct tm* localtime_r(const time_t* inTimeT,struct tm* outRetval)
 {
   struct tm* retval = NULL;
   
   if(NULL != inTimeT && NULL != outRetval) {
     SYSTEMTIME winLocalTime;
     
     time_t_2_LOCALSYSTEMTIME(winLocalTime, *inTimeT);
     
@@ -148,22 +148,22 @@ static struct tm* mozce_localtime_r(cons
     retval = outRetval;
   }
   return retval;
 }
 
 
 struct tm* localtime(const time_t* inTimeT)
 {
-  return mozce_localtime_r(inTimeT, &tmStorage);
+  return localtime_r(inTimeT, &tmStorage);
 }
 
 struct tm* gmtime(const time_t* inTimeT)
 {
-  return mozce_gmtime_r(inTimeT, &tmStorage);
+  return gmtime_r(inTimeT, &tmStorage);
 }
 
 
 time_t mktime(struct tm* inTM)
 {
   time_t retval = (time_t)-1;
   
   if(NULL != inTM) {
@@ -186,17 +186,17 @@ time_t mktime(struct tm* inTM)
     /*
      * First get our time_t.
      */
     SYSTEMTIME_2_time_t(retval, winTime);
     
     /*
      * Now overwrite the struct passed in with what we believe it should be.
      */
-    gmTime = mozce_gmtime_r(&retval, inTM);
+    gmTime = gmtime_r(&retval, inTM);
   }
   return retval;
 }
 
 time_t time(time_t *)
 {
   time_t retval;
   SYSTEMTIME winTime;
--- a/configure.in
+++ b/configure.in
@@ -2105,16 +2105,17 @@ case "$target" in
     AC_DEFINE(_WIN32)
     AC_DEFINE(WIN32)
     AC_DEFINE(XP_WIN)
     AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(NEW_H, <new>)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
+    AC_DEFINE(HAVE_LOCALTIME_R)
 
     TARGET_MD_ARCH=win32
     _PLATFORM_DEFAULT_TOOLKIT='windows'
     BIN_SUFFIX='.exe'
     USE_SHORT_LIBNAME=1
     MOZ_ENABLE_POSTSCRIPT=
     MOZ_USER_DIR="Mozilla"