mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 22:20:56 +00:00
Merge pull request #3498 from ncpenke/gcc-4.4.3-support
Gcc 4.4.3 support
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// Convert an integer or floating point value to a string.
|
||||
@@ -68,7 +70,7 @@ template<> inline std::string NumToString<double>(double t) {
|
||||
auto p = s.find_last_not_of('0');
|
||||
if (p != std::string::npos) {
|
||||
s.resize(p + 1); // Strip trailing zeroes.
|
||||
if (s.back() == '.')
|
||||
if (s[s.size() - 1] == '.')
|
||||
s.erase(s.size() - 1, 1); // Strip '.' if a whole number.
|
||||
}
|
||||
return s;
|
||||
@@ -197,8 +199,8 @@ inline std::string StripFileName(const std::string &filepath) {
|
||||
inline std::string ConCatPathFileName(const std::string &path,
|
||||
const std::string &filename) {
|
||||
std::string filepath = path;
|
||||
if (path.length() && path.back() != kPathSeparator &&
|
||||
path.back() != kPosixPathSeparator)
|
||||
if (path.length() && path[path.size() - 1] != kPathSeparator &&
|
||||
path[path.size() - 1] != kPosixPathSeparator)
|
||||
filepath += kPathSeparator;
|
||||
filepath += filename;
|
||||
return filepath;
|
||||
|
||||
Reference in New Issue
Block a user