diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-26 19:23:44 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-26 19:23:44 +0000 |
commit | d1fe2888a6192dea6748e3dbc332c2e948ae48e6 (patch) | |
tree | 8fd91eca51ba5a158a102f2eb9e2e579cefa14e9 | |
parent | 8fc3c6f7f33b3292a0b6b8d3cc287fb8fdeca2e0 (diff) | |
download | ATCD-d1fe2888a6192dea6748e3dbc332c2e948ae48e6.tar.gz |
Fixed difftime with help from Arturo. Fixed tempnam with
ACE_LACKS_TEMPNAM.
-rw-r--r-- | ace/OS.h | 7 | ||||
-rw-r--r-- | ace/OS.i | 29 |
2 files changed, 35 insertions, 1 deletions
@@ -2733,9 +2733,14 @@ public: #undef getpwnam_r #endif /* ACE_HAS_BROKEN_R_ROUTINES */ +#if defined (difftime) +#define ACE_DIFFTIME(t1, t0) difftime(t1,t0) +#undef difftime +#endif /* difftime */ + // = A set of wrappers for operations on time. - static time_t time (time_t *tloc); static double difftime (time_t t1, time_t t0); + static time_t time (time_t *tloc); static time_t mktime (struct tm *timeptr); static struct tm *localtime (const time_t *clock); static struct tm *localtime_r (const time_t *clock, struct tm *res); @@ -912,6 +912,23 @@ ACE_OS::unlink (const char *path) #endif /* VXWORKS */ } + +ACE_INLINE char * +ACE_OS::tempnam (const char *dir, const char *pfx) +{ + // ACE_TRACE ("ACE_OS::tempnam"); +#if defined (VXWORKS) || defined (ACE_LACKS_TEMPNAM) + ACE_NOTSUP_RETURN (0); +#else +#if defined (WIN32) + ACE_OSCALL_RETURN (::_tempnam (dir, pfx), char *, 0); +#else + ACE_OSCALL_RETURN (::tempnam (dir, pfx), char *, 0); +#endif /* WIN32 */ +#endif /* VXWORKS */ +} + + ACE_INLINE LPTSTR ACE_OS::cuserid (LPTSTR user, size_t maxlen) { @@ -5641,6 +5658,18 @@ ACE_OS::open (const char *filename, #endif /* ACE_WIN32 */ } + +ACE_INLINE double +ACE_OS::difftime (time_t t1, time_t t0) +{ +#if defined (ACE_DIFFTIME) + return ACE_DIFFTIME(t1, t0); +#else + return ::difftime (t1, t0); +#endif /* ACE_DIFFTIME */ +} + + ACE_INLINE char * ACE_OS::ctime (const time_t *t) { |