diff --git a/include/boost/limits.hpp b/include/boost/limits.hpp index 1d2ca138..8d110bd6 100644 --- a/include/boost/limits.hpp +++ b/include/boost/limits.hpp @@ -12,9 +12,64 @@ #include #ifdef BOOST_NO_LIMITS -#include +# include #else -#include +# include #endif +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 && !defined(__SGI_STL_PORT) && !defined(_CPPLIB_VER) +// Add missing specializations for MSVC +namespace std +{ + class numeric_limits<__int64> : public _Num_int_base { + public: + static __int64 (__cdecl min)() _THROW0() + {return (_I64_MIN); } + static __int64 (__cdecl max)() _THROW0() + {return (_I64_MAX); } + static __int64 __cdecl epsilon() _THROW0() + {return 0; } + static __int64 __cdecl round_error() _THROW0() + {return 0; } + static __int64 __cdecl denorm_min() _THROW0() + {return 0; } + static __int64 __cdecl infinity() _THROW0() + {return 0; } + static __int64 __cdecl quiet_NaN() _THROW0() + {return 0; } + static __int64 __cdecl signaling_NaN() _THROW0() + {return 0; } + + _STCONS(bool, is_signed, true); + _STCONS(int, digits, CHAR_BIT * sizeof (__int64) - 1); + _STCONS(int, digits10, (CHAR_BIT * sizeof (__int64) - 1) + * 301L / 1000); + }; + + class numeric_limits : public _Num_int_base { + public: + static unsigned __int64 (__cdecl min)() _THROW0() + {return 0; } + static unsigned __int64 (__cdecl max)() _THROW0() + {return (_UI64_MAX); } + static unsigned __int64 __cdecl epsilon() _THROW0() + {return 0; } + static unsigned __int64 __cdecl round_error() _THROW0() + {return 0; } + static unsigned __int64 __cdecl denorm_min() _THROW0() + {return 0; } + static unsigned __int64 __cdecl infinity() _THROW0() + {return 0; } + static unsigned __int64 __cdecl quiet_NaN() _THROW0() + {return 0; } + static unsigned __int64 __cdecl signaling_NaN() _THROW0() + {return 0; } + _STCONS(bool, is_signed, false); + _STCONS(int, digits, CHAR_BIT * sizeof (unsigned __int64)); + _STCONS(int, digits10, (CHAR_BIT * sizeof (unsigned __int64)) + * 301L / 1000); + }; +} +#endif + #endif