diff options
Diffstat (limited to 'ace/OS_NS_stdlib.h')
-rw-r--r-- | ace/OS_NS_stdlib.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ace/OS_NS_stdlib.h b/ace/OS_NS_stdlib.h index 5b278151bdc..8385df4da44 100644 --- a/ace/OS_NS_stdlib.h +++ b/ace/OS_NS_stdlib.h @@ -53,6 +53,37 @@ extern "C" { # undef atop #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_STRTOLL) && !defined (ACE_STRTOLL_EQUIVALENT) +inline ACE_INT64 ace_strtoll_helper (const char *s, char **ptr, int base) +{ +# if defined (strtoll) + return strtoll (s, ptr, base); +# undef strtoll +# else + return ACE_STD_NAMESPACE::strtoll (s, ptr, base); +# endif /* strtoll */ +} +#endif /* !ACE_LACKS_STRTOLL && !ACE_STRTOLL_EQUIVALENT */ + +#if !defined (ACE_LACKS_STRTOULL) && !defined (ACE_STRTOULL_EQUIVALENT) +inline ACE_INT64 ace_strtoull_helper (const char *s, char **ptr, int base) +{ +# if defined (strtoull) + return strtoull (s, ptr, base); +# undef strtoull +# else + return ACE_STD_NAMESPACE::strtoull (s, ptr, base); +# endif /* strtoull */ +} +#endif /* !ACE_LACKS_STRTOULL && !ACE_STRTOULL_EQUIVALENT */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { |