diff options
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ace/Numeric_Limits.h | 168 | ||||
-rw-r--r-- | ACE/ace/README | 1 | ||||
-rw-r--r-- | ACE/ace/config-hpux-11.00.h | 3 |
3 files changed, 8 insertions, 164 deletions
diff --git a/ACE/ace/Numeric_Limits.h b/ACE/ace/Numeric_Limits.h index b842ef71de9..0f888f8ca62 100644 --- a/ACE/ace/Numeric_Limits.h +++ b/ACE/ace/Numeric_Limits.h @@ -27,15 +27,11 @@ #include /**/ "ace/ACE_export.h" -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ -#ifdef ACE_LACKS_NUMERIC_LIMITS -# include "ace/Basic_Types.h" -#else - -# if defined __MINGW32__ +#if defined __MINGW32__ // Windows defines min/max macros that interfere with the // numeric_limits::min/max() traits. Undefine those macros before // including <limits>. @@ -46,12 +42,11 @@ // that would probably break some applications. // // @@ Why isn't this a problem with MSVC++ and Borland builds? -# undef min -# undef max -# endif /* __MINGW32__ */ +# undef min +# undef max +#endif /* __MINGW32__ */ -# include <limits> -#endif /* ACE_LACKS_NUMERIC_LIMITS */ +#include <limits> // Address global namespace pollution potentially incurred by some // platforms. @@ -60,153 +55,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -#ifdef ACE_LACKS_NUMERIC_LIMITS - -template <typename T> struct ACE_Numeric_Limits; - - -// ------------------------------------------ -// Special cases. -template<> -struct ACE_Export ACE_Numeric_Limits<char> -{ - static char min (void) { return CHAR_MIN; } - static char max (void) { return CHAR_MAX; } -}; - -// ------------------------------------------ -// Signed integers. - -template<> -struct ACE_Export ACE_Numeric_Limits<signed char> -{ - static signed char min (void) { return SCHAR_MIN; } - static signed char max (void) { return SCHAR_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<signed short> -{ - static signed short min (void) { return SHRT_MIN; } - static signed short max (void) { return SHRT_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<signed int> -{ - static signed int min (void) { return INT_MIN; } - static signed int max (void) { return INT_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<signed long> -{ - static signed long min (void) { return LONG_MIN; } - static signed long max (void) { return LONG_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<signed long long> -{ -#if defined (LLONG_MIN) -# define ACE_LLONG_MIN LLONG_MIN -#elif defined (LONG_LONG_MIN) -# define ACE_LLONG_MIN LONG_LONG_MIN -#elif defined (LONGLONG_MIN) -# define ACE_LLONG_MIN LONGLONG_MIN -#else -# error Unable to determine minimum signed long long value. -#endif /* LLONG_MIN */ - -#if defined (LLONG_MAX) -# define ACE_LLONG_MAX LLONG_MAX -#elif defined (LONG_LONG_MAX) -# define ACE_LLONG_MAX LONG_LONG_MAX -#elif defined (LONGLONG_MAX) -# define ACE_LLONG_MAX LONGLONG_MAX -#else -# error Unable to determine maximum signed long long value. -#endif /* LLONG_MAX */ - - static signed long long min (void) { return ACE_LLONG_MIN; } - static signed long long max (void) { return ACE_LLONG_MAX; } -}; - -// ------------------------------------------ -// Unsigned integers -template<> -struct ACE_Export ACE_Numeric_Limits<unsigned char> -{ - static unsigned char min (void) { return 0; } - static unsigned char max (void) { return UCHAR_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<unsigned short> -{ - static unsigned short min (void) { return 0; } - static unsigned short max (void) { return USHRT_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<unsigned int> -{ - static unsigned int min (void) { return 0; } - static unsigned int max (void) { return UINT_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<unsigned long> -{ - static unsigned long min (void) { return 0; } - static unsigned long max (void) { return ULONG_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<unsigned long long> -{ - static unsigned long long min (void) { return 0; } - static unsigned long long max (void) - { -# if defined (ULLONG_MAX) - return ULLONG_MAX; -# elif defined (ULONGLONG_MAX) - return ULONGLONG_MAX; -# else -# error Unable to determine maximum unsigned long long value. -# endif /* ULLONG_MAX */ - } -}; - -// ------------------------------------------ -// Floating point types - -template<> -struct ACE_Export ACE_Numeric_Limits<float> -{ - static float min (void) { return FLT_MIN; } - static float max (void) { return FLT_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<double> -{ - static double min (void) { return DBL_MIN; } - static double max (void) { return DBL_MAX; } -}; - -template<> -struct ACE_Export ACE_Numeric_Limits<long double> -{ - static long double min (void) { return LDBL_MIN; } - static long double max (void) { return LDBL_MAX; } -}; - -#else - // std::numeric_limits<> has all of the necessary specializations. // Just wrap it. - template <typename T> struct ACE_Numeric_Limits { @@ -214,8 +64,6 @@ struct ACE_Numeric_Limits static T max () { return std::numeric_limits<T>::max (); } }; -#endif /* ACE_LACKS_NUMERIC_LIMITS */ - ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/ACE/ace/README b/ACE/ace/README index e975426f438..722ef6682fb 100644 --- a/ACE/ace/README +++ b/ACE/ace/README @@ -886,7 +886,6 @@ ACE_LACKS_NEW_H OS doesn't have, or we don't want to use, new.h. ACE_LACKS_NULL_PTHREAD_STATUS OS requires non-null status pointer for ::pthread_join (). -ACE_LACKS_NUMERIC_LIMITS Platform lacks std::numeric_limits<>. ACE_LACKS_PERFECT_MULTICAST_FILTERING Platform lacks IGMPv3 "perfect" filtering of multicast dgrams at the socket level. If == 1, ACE_SOCK_Dgram_Mcast will bind diff --git a/ACE/ace/config-hpux-11.00.h b/ACE/ace/config-hpux-11.00.h index 23d754068db..0e46c5df815 100644 --- a/ACE/ace/config-hpux-11.00.h +++ b/ACE/ace/config-hpux-11.00.h @@ -42,9 +42,6 @@ # endif /* RWSTD_NO_NAMESPACE */ # else # define ACE_USES_OLD_IOSTREAMS - // There's no support in ACE's use of numeric_limits for those that - // aren't in std:: -# define ACE_LACKS_NUMERIC_LIMITS # endif /* _HP_NAMESPACE_STD */ # define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR |