summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@users.noreply.github.com>2016-09-05 09:32:25 +0200
committerGitHub <noreply@github.com>2016-09-05 09:32:25 +0200
commit4309725bbebeb3fb6027766915fd2f6922f54eea (patch)
treed7a8805a0e60b125dbe1187a7effaab36bdbbcd3
parente13ee56ffabd908059f5bc74c85d22370ea39412 (diff)
downloadATCD-revert-262-master.tar.gz
Revert "Handle system functions that may be defined as macros on some platforms"revert-262-master
-rw-r--r--ACE/ace/OS_NS_stdlib.h12
-rw-r--r--ACE/ace/OS_NS_stdlib.inl2
-rw-r--r--ACE/ace/OS_NS_time.cpp2
-rw-r--r--ACE/ace/OS_NS_time.h41
-rw-r--r--ACE/ace/OS_NS_time.inl4
5 files changed, 4 insertions, 57 deletions
diff --git a/ACE/ace/OS_NS_stdlib.h b/ACE/ace/OS_NS_stdlib.h
index 6d5d0baf642..c7b89a06fc3 100644
--- a/ACE/ace/OS_NS_stdlib.h
+++ b/ACE/ace/OS_NS_stdlib.h
@@ -77,18 +77,6 @@ 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)
- return rand_r (seed);
-# undef rand_r
-# else
- return ACE_STD_NAMESPACE::rand_r (seed);
-# endif /* rand_r */
-}
-#endif /* !ACE_LACKS_RAND_R */
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_OS {
diff --git a/ACE/ace/OS_NS_stdlib.inl b/ACE/ace/OS_NS_stdlib.inl
index cb59874b3cf..2c0f4c36991 100644
--- a/ACE/ace/OS_NS_stdlib.inl
+++ b/ACE/ace/OS_NS_stdlib.inl
@@ -431,7 +431,7 @@ ACE_OS::rand_r (unsigned int *seed)
*seed = (unsigned int)new_seed;
return (int) (new_seed & RAND_MAX);
#else
- return ace_rand_r_helper (seed);
+ return ::rand_r (seed);
# endif /* ACE_LACKS_RAND_R */
}
diff --git a/ACE/ace/OS_NS_time.cpp b/ACE/ace/OS_NS_time.cpp
index 2ab3c7ebe47..3d4fcc93d47 100644
--- a/ACE/ace/OS_NS_time.cpp
+++ b/ACE/ace/OS_NS_time.cpp
@@ -287,7 +287,7 @@ ACE_OS::localtime_r (const time_t *t, struct tm *res)
return res;
}
#else
- return ace_localtime_r_helper (t, res);
+ ACE_OSCALL_RETURN (::localtime_r (t, res), struct tm *, 0);
#endif /* ACE_HAS_TR24731_2005_CRT */
}
diff --git a/ACE/ace/OS_NS_time.h b/ACE/ace/OS_NS_time.h
index 4fddbdb1571..11d226ea28b 100644
--- a/ACE/ace/OS_NS_time.h
+++ b/ACE/ace/OS_NS_time.h
@@ -90,47 +90,6 @@ inline long ace_timezone()
#endif
}
-/*
- * We inline and undef some functions that may be implemented
- * as macros on some platforms. This way macro definitions will
- * be usable later as there is no way to save the macro definition
- * using the pre-processor.
- */
-#if !defined (ACE_LACKS_ASCTIME_R) && !defined (ACE_HAS_TR24731_2005_CRT)
-inline char *ace_asctime_r_helper (const struct tm *t, char *buf)
-{
-# if defined (asctime_r)
- return asctime_r (t, buf);
-# undef asctime_r
-# else
- return ACE_STD_NAMESPACE::asctime_r (t, buf);
-# endif /* asctime_r */
-}
-#endif /* !ACE_LACKS_ASCTIME_R && !ACE_HAS_TR24731_2005_CRT */
-
-#if !defined (ACE_LACKS_GMTIME_R) && !defined (ACE_HAS_TR24731_2005_CRT)
-inline struct tm *ace_gmtime_r_helper (const time_t *clock, struct tm *res)
-{
-# if defined (gmtime_r)
- return gmtime_r (clock, res);
-# undef gmtime_r
-# else
- return ACE_STD_NAMESPACE::gmtime_r (clock, res);
-# endif /* gmtime_r */
-}
-#endif /* !ACE_LACKS_GMTIME_R && !ACE_HAS_TR24731_2005_CRT */
-
-#if !defined (ACE_LACKS_LOCALTIME_R) && !defined (ACE_HAS_TR24731_2005_CRT)
-inline struct tm *ace_localtime_r_helper (const time_t *clock, struct tm *res)
-{
-# if defined (localtime_r)
- return localtime_r (clock, res);
-# undef localtime_r
-# else
- return ACE_STD_NAMESPACE::localtime_r (clock, res);
-# endif /* localtime_r */
-}
-#endif /* !ACE_LACKS_LOCALTIME_R && !ACE_HAS_TR24731_2005_CRT */
#if !defined (ACE_LACKS_DIFFTIME)
# if defined (_WIN32_WCE) && ((_WIN32_WCE >= 0x600) && (_WIN32_WCE <= 0x700)) && !defined (_USE_32BIT_TIME_T) \
diff --git a/ACE/ace/OS_NS_time.inl b/ACE/ace/OS_NS_time.inl
index f066be30b60..c821530bc82 100644
--- a/ACE/ace/OS_NS_time.inl
+++ b/ACE/ace/OS_NS_time.inl
@@ -26,7 +26,7 @@ ACE_OS::asctime_r (const struct tm *t, char *buf, int buflen)
#if defined (ACE_HAS_REENTRANT_FUNCTIONS)
# if defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R)
char *result = 0;
- ace_asctime_r_helper (t, buf);
+ ACE_OSCALL (::asctime_r (t, buf), char *, 0, result);
ACE_OS::strsncpy (buf, result, buflen);
return buf;
# else
@@ -375,7 +375,7 @@ ACE_OS::gmtime_r (const time_t *t, struct tm *res)
{
ACE_OS_TRACE ("ACE_OS::gmtime_r");
#if defined (ACE_HAS_REENTRANT_FUNCTIONS)
- return ace_gmtime_r_helper (t, res);
+ ACE_OSCALL_RETURN (::gmtime_r (t, res), struct tm *, 0);
#elif defined (ACE_HAS_TR24731_2005_CRT)
struct tm *tm_p = res;
ACE_SECURECRTCALL (gmtime_s (res, t), struct tm *, 0, tm_p);