From cf549d5e0cd80c1b6c181a4aaf8095155720bcfb Mon Sep 17 00:00:00 2001 From: ysh329 Date: Thu, 23 Jul 2020 14:19:14 +0800 Subject: [PATCH] fix undef replace stl pad of android armv8 static lib. test=develop (#3977) --- lite/utils/replace_stl/stream.cc | 17 ++++++++--------- lite/utils/replace_stl/stream.h | 2 ++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lite/utils/replace_stl/stream.cc b/lite/utils/replace_stl/stream.cc index 081006be67..8e14e4d6d5 100644 --- a/lite/utils/replace_stl/stream.cc +++ b/lite/utils/replace_stl/stream.cc @@ -23,6 +23,14 @@ namespace paddle { namespace lite { namespace replace_stl { +#ifndef LITE_WITH_LOG +#define ADD_DATA_AS_STRING(data_, obj_) +#else +#define ADD_DATA_AS_STRING(data_, obj_) \ + std::string text = std::to_string(obj_); \ + pad(text); \ + data_ = data_ + text; + void ostream::pad(const std::string& text) { if (display_width_ > 0) { if (display_width_ < text.size()) { @@ -36,15 +44,6 @@ void ostream::pad(const std::string& text) { } } } - -#ifndef LITE_WITH_LOG -#define ADD_DATA_AS_STRING(data_, obj_) -#else -#define ADD_DATA_AS_STRING(data_, obj_) \ - std::string text = std::to_string(obj_); \ - pad(text); \ - data_ = data_ + text; - #endif template <> diff --git a/lite/utils/replace_stl/stream.h b/lite/utils/replace_stl/stream.h index 3288a19869..c58265a0cd 100644 --- a/lite/utils/replace_stl/stream.h +++ b/lite/utils/replace_stl/stream.h @@ -57,7 +57,9 @@ class ostream { ostream& operator<<(const T* obj); private: +#ifdef LITE_WITH_LOG void pad(const std::string& text); +#endif std::string data_; int display_width_{-1}; // -1 refers to no setting }; -- GitLab