# # # patch "base.hh" # from [30e4d2d7e93d3b32c403d00aa4f7b81d7a67af5a] # to [8ee936d762b2115fbaa7e54dc25ee634490c5fc9] # # patch "m4/numeric_vocab.m4" # from [ba2358bd856f2755a9857de56784fb99f6d0b336] # to [b7dbcc2b119be3282da0de455973147121bdd189] # # patch "sanity.cc" # from [b23726a9190f9f57fc53f6a30b63e11844883c6d] # to [0569b8784dc3c6529d24cfd87ea22ea6dcece8ab] # ============================================================ --- base.hh 30e4d2d7e93d3b32c403d00aa4f7b81d7a67af5a +++ base.hh 8ee936d762b2115fbaa7e54dc25ee634490c5fc9 @@ -48,11 +48,16 @@ template <> void dump(bool const & obj, template <> void dump(std::string const & obj, std::string & out); template <> void dump(char const * const & obj, std::string & out); template <> void dump(bool const & obj, std::string & out); -template <> void dump(s32 const & obj, std::string & out); -template <> void dump(u32 const & obj, std::string & out); -template <> void dump(s64 const & obj, std::string & out); -template <> void dump(u64 const & obj, std::string & out); -template <> void dump(size_t const & obj, std::string & out); +template <> void dump(int const & obj, std::string & out); +template <> void dump(unsigned int const & obj, std::string & out); +template <> void dump(long const & obj, std::string & out); +template <> void dump(unsigned long const & obj, std::string & out); +#ifdef USING_LONG_LONG +// I don't think these are standard, so only specialize on them +// if we're actually using them. +template <> void dump(long long const & obj, std::string & out); +template <> void dump(unsigned long long const & obj, std::string & out); +#endif // NORETURN(void function()); declares a function that will never return // in the normal fashion. a function that invariably throws an exception ============================================================ --- m4/numeric_vocab.m4 ba2358bd856f2755a9857de56784fb99f6d0b336 +++ m4/numeric_vocab.m4 b7dbcc2b119be3282da0de455973147121bdd189 @@ -123,6 +123,7 @@ if test "$mtn_s64_type" = unknown; then if test "$mtn_s64_type" = unknown then AC_MSG_ERROR([*** no signed 64-bit type found]) fi + AC_DEFINE_UNQUOTED([USING_LONG_LONG], [1], [Whether we're using `long long' and need appropriate specializations.]) fi AC_DEFINE_UNQUOTED([TYPE_S8], [$mtn_s8_type], [Type to use for `s8'.]) ============================================================ --- sanity.cc b23726a9190f9f57fc53f6a30b63e11844883c6d +++ sanity.cc 0569b8784dc3c6529d24cfd87ea22ea6dcece8ab @@ -462,30 +462,37 @@ template <> void out = (obj ? "true" : "false"); } template <> void -dump(s32 const & val, string & out) +dump(int const & val, string & out) { out = lexical_cast(val); } template <> void -dump(u32 const & val, string & out) +dump(unsigned int const & val, string & out) { out = lexical_cast(val); } template <> void -dump(s64 const & val, string & out) +dump(long const & val, string & out) { out = lexical_cast(val); } template <> void -dump(u64 const & val, string & out) +dump(unsigned long const & val, string & out) { out = lexical_cast(val); } +#ifdef USING_LONG_LONG template <> void -dump(size_t const & val, string & out) +dump(long long const & val, string & out) { out = lexical_cast(val); } +template <> void +dump(unsigned long long const & val, string & out) +{ + out = lexical_cast(val); +} +#endif void sanity::print_var(std::string const & value, char const * var,