summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_NS_time.cpp
diff options
context:
space:
mode:
authorolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-03-16 14:02:24 +0000
committerolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-03-16 14:02:24 +0000
commit5589db1d2a009aff35d50c919e73a8431c5df464 (patch)
tree2bc452474be85c73a64fa1c2e301ea4f03197ce7 /ACE/ace/OS_NS_time.cpp
parent1c64cbeffd4f929fdfa7c74d77ae30a0f159db18 (diff)
downloadATCD-5589db1d2a009aff35d50c919e73a8431c5df464.tar.gz
ChangeLogTag: Wed Mar 16 14:00:26 UTC 2011 Olli Savia <ops@iki.fi>
Diffstat (limited to 'ACE/ace/OS_NS_time.cpp')
-rw-r--r--ACE/ace/OS_NS_time.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/ACE/ace/OS_NS_time.cpp b/ACE/ace/OS_NS_time.cpp
index 8e93ffb7c78..db48047f50d 100644
--- a/ACE/ace/OS_NS_time.cpp
+++ b/ACE/ace/OS_NS_time.cpp
@@ -223,24 +223,9 @@ struct tm *
ACE_OS::localtime_r (const time_t *t, struct tm *res)
{
ACE_OS_TRACE ("ACE_OS::localtime_r");
-#if defined (ACE_HAS_REENTRANT_FUNCTIONS)
- ACE_OSCALL_RETURN (::localtime_r (t, res), struct tm *, 0);
-#elif defined (ACE_HAS_TR24731_2005_CRT)
+#if defined (ACE_HAS_TR24731_2005_CRT)
ACE_SECURECRTCALL (localtime_s (res, t), struct tm *, 0, res);
return res;
-#elif !defined (ACE_HAS_WINCE)
- ACE_OS_GUARD
-
- ACE_UNUSED_ARG (res);
- struct tm * res_ptr = 0;
- ACE_OSCALL (::localtime (t), struct tm *, 0, res_ptr);
- if (res_ptr == 0)
- return 0;
- else
- {
- *res = *res_ptr;
- return res;
- }
#elif defined (ACE_HAS_WINCE)
// This is really stupid, converting FILETIME to timeval back and
// forth. It assumes FILETIME and DWORDLONG are the same structure
@@ -290,13 +275,22 @@ ACE_OS::localtime_r (const time_t *t, struct tm *res)
res->tm_year = res->tm_year - 1900;
return res;
-#else
- // @@ Same as ACE_OS::localtime (), you need to implement it
- // yourself.
- ACE_UNUSED_ARG (t);
+#elif defined (ACE_LACKS_LOCALTIME_R)
+ ACE_OS_GUARD
+
ACE_UNUSED_ARG (res);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_REENTRANT_FUNCTIONS */
+ struct tm * res_ptr = 0;
+ ACE_OSCALL (::localtime (t), struct tm *, 0, res_ptr);
+ if (res_ptr == 0)
+ return 0;
+ else
+ {
+ *res = *res_ptr;
+ return res;
+ }
+#else
+ ACE_OSCALL_RETURN (::localtime_r (t, res), struct tm *, 0);
+#endif /* ACE_HAS_TR24731_2005_CRT */
}
time_t