diff options
author | Olli Savia <ops@iki.fi> | 2016-09-03 08:35:59 +0300 |
---|---|---|
committer | Olli Savia <ops@iki.fi> | 2016-09-03 08:35:59 +0300 |
commit | 7c3da81689d2b47e71b60d36533cf0116565d72e (patch) | |
tree | da149e96766260c9e9b77b322e5422d2763505cc | |
parent | 044091d7873086e1ecd54808e7652e9ae0025d31 (diff) | |
download | ATCD-7c3da81689d2b47e71b60d36533cf0116565d72e.tar.gz |
Handle platforms that lack reentrant functions
-rw-r--r-- | ACE/ace/OS_NS_stdlib.h | 10 | ||||
-rw-r--r-- | ACE/ace/OS_NS_time.h | 30 |
2 files changed, 24 insertions, 16 deletions
diff --git a/ACE/ace/OS_NS_stdlib.h b/ACE/ace/OS_NS_stdlib.h index 95e65410297..6d5d0baf642 100644 --- a/ACE/ace/OS_NS_stdlib.h +++ b/ACE/ace/OS_NS_stdlib.h @@ -77,15 +77,17 @@ inline ACE_INT64 ace_strtoull_helper (const char *s, char **ptr, int base) } #endif /* !ACE_LACKS_STRTOULL && !ACE_STRTOULL_EQUIVALENT */ +#if !defined (ACE_LACKS_RAND_R) inline int ace_rand_r_helper (unsigned *seed) { -#if defined (rand_r) +# if defined (rand_r) return rand_r (seed); -#undef rand_r -#else +# undef rand_r +# else return ACE_STD_NAMESPACE::rand_r (seed); -#endif /* rand_r */ +# endif /* rand_r */ } +#endif /* !ACE_LACKS_RAND_R */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/OS_NS_time.h b/ACE/ace/OS_NS_time.h index 013276eb00a..dec111def52 100644 --- a/ACE/ace/OS_NS_time.h +++ b/ACE/ace/OS_NS_time.h @@ -96,35 +96,41 @@ inline long ace_timezone() * be usable later as there is no way to save the macro definition * using the pre-processor. */ +#if !defined (ACE_LACKS_ASCTIME_R) inline char *ace_asctime_r_helper (const struct tm *t, char *buf) { -#if defined (asctime_r) +# if defined (asctime_r) return asctime_r (t, buf); -#undef asctime_r -#else +# undef asctime_r +# else return ACE_STD_NAMESPACE::asctime_r (t, buf); -#endif /* defined (asctime_r) */ +# endif /* asctime_r */ } +#endif /* !ACE_LACKS_ASCTIME_R */ +#if !defined (ACE_LACKS_GMTIME_R) inline struct tm *ace_gmtime_r_helper (const time_t *clock, struct tm *res) { -#if defined (gmtime_r) +# if defined (gmtime_r) return gmtime_r (clock, res); -#undef gmtime_r -#else +# undef gmtime_r +# else return ACE_STD_NAMESPACE::gmtime_r (clock, res); -#endif /* defined (gmtime_r) */ +# endif /* gmtime_r */ } +#endif /* !ACE_LACKS_GMTIME_R */ +#if !defined (ACE_LACKS_LOCALTIME_R) inline struct tm *ace_localtime_r_helper (const time_t *clock, struct tm *res) { -#if defined (localtime_r) +# if defined (localtime_r) return localtime_r (clock, res); -#undef localtime_r -#else +# undef localtime_r +# else return ACE_STD_NAMESPACE::localtime_r (clock, res); -#endif /* defined (localtime_r) */ +# endif /* localtime_r */ } +#endif /* !ACE_LACKS_LOCALTIME_R */ #if !defined (ACE_LACKS_DIFFTIME) # if defined (_WIN32_WCE) && ((_WIN32_WCE >= 0x600) && (_WIN32_WCE <= 0x700)) && !defined (_USE_32BIT_TIME_T) \ |