From: Kefu Chai Date: Sat, 25 Jun 2016 17:02:03 +0000 (+0800) Subject: common: instantiate strict_si_cast not strict_si_cast X-Git-Tag: ses5-milestone5~463^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=31db4c5f9f725e13e38f3c90744e299e023d02a4;p=ceph.git common: instantiate strict_si_cast not strict_si_cast this fixes the build on armf. on 32bit platforms, cstdint is very likely to typedef long long int int64_t; this results in compilation error like `common/strtol.cc:190:75: error: duplicate explicit instantiation of 'T strict_si_cast(const char, std::string) [with T = long long int; std::string = std::basic_string]' [-fpermissive] template int64_t strict_si_cast(const char *str, std::string *err); ^` we can address this by instantiate the primitive type of `long long` instead of `in64_t`. Fixes: http://tracker.ceph.com/issues/16398 Signed-off-by: Kefu Chai --- diff --git a/src/common/strtol.cc b/src/common/strtol.cc index 0e7ea7d30114..321521d1f2df 100644 --- a/src/common/strtol.cc +++ b/src/common/strtol.cc @@ -186,8 +186,8 @@ T strict_si_cast(const char *str, std::string *err) } template int strict_si_cast(const char *str, std::string *err); +template long strict_si_cast(const char *str, std::string *err); template long long strict_si_cast(const char *str, std::string *err); -template int64_t strict_si_cast(const char *str, std::string *err); template uint64_t strict_si_cast(const char *str, std::string *err); template uint32_t strict_si_cast(const char *str, std::string *err);