Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / os_include / os_time.h
blobeb716ff27ecf23de361015fb72251aacd4382b0b
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file os_time.h
7 * time types
9 * @author Don Hinton <dhinton@dresystems.com>
10 * @author This code was originally in various places including ace/OS.h.
12 //=============================================================================
14 #ifndef ACE_OS_INCLUDE_OS_TIME_H
15 #define ACE_OS_INCLUDE_OS_TIME_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/config-lite.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 // @todo should we include anything from signal.h?
26 #include "ace/os_include/sys/os_types.h"
28 // To get the proper select() signature, this is required for maybe other platforms
29 // that offer both int and fdset forms of select().
30 #if !defined (ACE_LACKS_SYS_TIME_H)
31 # include /**/ <sys/time.h>
32 #endif /* !ACE_LACKS_SYS_TIME_H */
34 #include /**/ <time.h>
36 #if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \
37 (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0)
38 using std::tm;
39 # if defined (ACE_WIN32)
40 using std::_timezone;
41 # else
42 using std::timezone;
43 # endif /* ACE_WIN32 */
44 using std::difftime;
45 #endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */
47 # if !defined (ACE_HAS_POSIX_TIME)
48 // Definition per POSIX.
49 typedef struct timespec
51 /// Seconds
52 time_t tv_sec;
53 /// Nanoseconds
54 long tv_nsec;
55 } timespec_t;
56 # endif /* !ACE_HAS_POSIX_TIME */
58 # if defined(ACE_LACKS_TIMESPEC_T)
59 typedef struct timespec timespec_t;
60 # endif /* ACE_LACKS_TIMESPEC_T */
62 // Place all additions (especially function declarations) within extern "C" {}
63 #ifdef __cplusplus
64 extern "C"
66 #endif /* __cplusplus */
68 // There are a lot of threads-related macro definitions in the config files.
69 // They came in at different times and from different places and platform
70 // requirements as threads evolved. They are probably not all needed - some
71 // overlap or are otherwise confused. This is an attempt to start
72 // straightening them out.
73 #if defined (ACE_HAS_PTHREADS) /* POSIX.1c threads (pthreads) */
74 // ... and 2-parameter asctime_r and ctime_r
75 # if !defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R) && !defined (ACE_VXWORKS)
76 # define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
77 # endif
78 #endif /* ACE_HAS_PTHREADS */
80 #if defined (ACE_LACKS_CONST_TIMESPEC_PTR)
81 typedef struct timespec * ACE_TIMESPEC_PTR;
82 #else
83 typedef const struct timespec * ACE_TIMESPEC_PTR;
84 #endif /* ACE_LACKS_CONST_TIMESPEC_PTR */
86 #ifdef __cplusplus
88 #endif /* __cplusplus */
90 #include /**/ "ace/post.h"
91 #endif /* ACE_OS_INCLUDE_OS_TIME_H */