summaryrefslogtreecommitdiff
path: root/devel/ace+tao/files/patch-ae
blob: 08503c23f486798ff94332ec1d34635f45120e6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
--- ace/OS_NS_time.h.orig	Thu Jun 11 23:14:04 1970
+++ ace/OS_NS_time.h	Mon Dec  6 02:46:06 2004
@@ -25,6 +25,7 @@
 #  pragma once
 # endif /* ACE_LACKS_PRAGMA_ONCE */
 
+#include "ace/OS_NS_errno.h"
 #include "ace/Basic_Types.h"
 #include "ace/os_include/os_time.h"
 #include "ace/ACE_export.h"
@@ -105,10 +106,6 @@
 #endif /* ACE_PSOS_HAS_TIME */
 
 #if defined (ACE_HAS_WINCE)
-  /// Supporting data for ctime and ctime_r functions on WinCE.
-  const wchar_t *day_of_week_name[7];
-  const wchar_t *month_name[12];
-
 // WinCE doesn't have most of the standard C library time functions. It
 // also doesn't define struct tm. SYSTEMTIME has pretty much the same
 // info though, so we can map it when needed. Define struct tm here and
@@ -137,48 +134,35 @@
  */
 inline long ace_timezone()
 {
-#if !defined (VXWORKS) && !defined (ACE_PSOS) && !defined (CHORUS)
-# if defined (ACE_HAS_WINCE)
+#if defined (ACE_HAS_WINCE)
   TIME_ZONE_INFORMATION tz;
   GetTimeZoneInformation (&tz);
   return tz.Bias * 60;
-# elif defined (ACE_WIN32) && !defined (ACE_HAS_DINKUM_STL)
+#elif defined (ACE_WIN32) && !defined (ACE_HAS_DINKUM_STL)
   return _timezone;  // For Win32.
-# elif defined (ACE_WIN32) && defined (ACE_HAS_DINKUM_STL)
+#elif defined (ACE_WIN32) && defined (ACE_HAS_DINKUM_STL)
   time_t tod = time(0);   // get current time
   time_t t1 = mktime(gmtime(&tod));   // convert without timezone
   time_t t2 = mktime(localtime(&tod));   // convert with timezone
   return difftime(t1, t2); // compute difference in seconds
-# elif defined (ACE_HAS_TIMEZONE_GETTIMEOFDAY) \
-	&& !defined (__linux__)  \
-	&& !defined (__FreeBSD__) \
-	&& !defined (__NetBSD__)
+#elif defined (ACE_HAS_TIMEZONE)
+  // The XPG/POSIX specification requires that tzset() be called to
+  // set the global variable <timezone>.
+  ::tzset();
+  return timezone;
+#elif defined (ACE_HAS_TIMEZONE_GETTIMEOFDAY)
   // The XPG/POSIX specification does not require gettimeofday to
   // set the timezone struct (it leaves the behavior of passing a
-  // non-null struct undefined).  We know gettimeofday() on Linux
-  // *BSD systems does not set the timezone, so we avoid using it
-  // and use the global variable <timezone> instead. 
-  //
-  // @note As of this writing, OpenBSD does not provide the global
-  // variable timezone.
-  //
-  // @todo It would be better if we had a feature test macro that
-  // could be used instead of a list of operating systems.
+  // non-null struct undefined). 
   long result = 0;
   struct timeval time;
   struct timezone zone;
   ACE_UNUSED_ARG (result);
   ACE_OSCALL (::gettimeofday (&time, &zone), int, -1, result);
   return zone.tz_minuteswest * 60;
-# else  /* ACE_HAS_TIMEZONE_GETTIMEOFDAY */
-  // The XPG/POSIX specification requires that tzset() be called to
-  // set the global variable <timezone>.
-  ::tzset();
-  return timezone;
-# endif /* ACE_HAS_TIMEZONE_GETTIMEOFDAY */
-#else
+#else  
   ACE_NOTSUP_RETURN (0);
-#endif /* !ACE_HAS_WINCE && !VXWORKS && !ACE_PSOS */
+#endif
 }
 
 
@@ -217,6 +201,8 @@
 #   endif // ACE_LACKS_LONGLONG_T
 # elif defined (ACE_PSOS)
 typedef ACE_UINT64 ACE_hrtime_t;
+# elif defined (_TNS_R_TARGET)
+typedef long long ACE_hrtime_t;
 # else /* !ACE_WIN32 && !ACE_PSOS */
 #   if defined (ACE_HAS_HI_RES_TIMER) &&  !defined (ACE_LACKS_LONGLONG_T)
   /* hrtime_t is defined on systems (Suns) with ACE_HAS_HI_RES_TIMER */
@@ -227,8 +213,22 @@
 # endif /* ACE_WIN32 */
 
 
+# if defined (ACE_HRTIME_T_IS_BASIC_TYPE)
+#   define ACE_HRTIME_CONVERSION(VAL) (VAL)
+#   define ACE_HRTIME_TO_U64(VAL) ACE_U_LongLong(VAL)
+# else
+#   define ACE_HRTIME_CONVERSION(VAL) ACE_U64_TO_U32(VAL)
+#   define ACE_HRTIME_TO_U64(VAL) (VAL)
+# endif
+
 
 namespace ACE_OS {
+
+# if defined (ACE_HAS_WINCE)
+  /// Supporting data for ctime and ctime_r functions on WinCE.
+  const wchar_t *day_of_week_name[];
+  const wchar_t *month_name[];
+# endif /* ACE_HAS_WINCE */
 
 # if defined (CHORUS) && !defined (CHORUS_4)
   // We must format this code as follows to avoid confusing OSE.