From f52ddfbd68fefcfdd3e4a371c6ff623f9b2322a7 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Fri, 21 Apr 2017 10:49:07 -0700 Subject: [PATCH] Fix Android STLPort build. Change-Id: Iceca7b8b455c8463d9b82b928332a875dee3d19e --- include/flatbuffers/util.h | 6 +----- src/idl_gen_cpp.cpp | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/flatbuffers/util.h b/include/flatbuffers/util.h index 008b18683..870d2b60b 100644 --- a/include/flatbuffers/util.h +++ b/include/flatbuffers/util.h @@ -42,6 +42,7 @@ #include "flatbuffers/flatbuffers.h" + namespace flatbuffers { // Convert an integer or floating point value to a string. @@ -114,11 +115,6 @@ inline uint64_t StringToUInt(const char *str, char **endptr = nullptr, #endif } -// Pedantic warning free version of toupper(). -inline char ToUpper(char c) { - return static_cast(::toupper(c)); -} - typedef bool (*LoadFileFunction)(const char *filename, bool binary, std::string *dest); typedef bool (*FileExistsFunction)(const char *filename); diff --git a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp index 6192212c9..b0fd11d7d 100644 --- a/src/idl_gen_cpp.cpp +++ b/src/idl_gen_cpp.cpp @@ -23,6 +23,11 @@ namespace flatbuffers { +// Pedantic warning free version of toupper(). +inline char ToUpper(char c) { + return static_cast(::toupper(c)); +} + static std::string GeneratedFileName(const std::string &path, const std::string &file_name) { return path + file_name + "_generated.h";