Skip to content

Commit 036be2a

Browse files
committed
fix undef replace stl pad of android armv8 static lib. test=develop (PaddlePaddle#3977)
1 parent c56bf0d commit 036be2a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lite/utils/replace_stl/stream.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ namespace paddle {
2323
namespace lite {
2424
namespace replace_stl {
2525

26+
#ifndef LITE_WITH_LOG
27+
#define ADD_DATA_AS_STRING(data_, obj_)
28+
#else
29+
#define ADD_DATA_AS_STRING(data_, obj_) \
30+
std::string text = std::to_string(obj_); \
31+
pad(text); \
32+
data_ = data_ + text;
33+
2634
void ostream::pad(const std::string& text) {
2735
if (display_width_ > 0) {
2836
if (display_width_ < text.size()) {
@@ -36,15 +44,6 @@ void ostream::pad(const std::string& text) {
3644
}
3745
}
3846
}
39-
40-
#ifndef LITE_WITH_LOG
41-
#define ADD_DATA_AS_STRING(data_, obj_)
42-
#else
43-
#define ADD_DATA_AS_STRING(data_, obj_) \
44-
std::string text = std::to_string(obj_); \
45-
pad(text); \
46-
data_ = data_ + text;
47-
4847
#endif
4948

5049
template <>

lite/utils/replace_stl/stream.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ class ostream {
5757
ostream& operator<<(const T* obj);
5858

5959
private:
60+
#ifdef LITE_WITH_LOG
6061
void pad(const std::string& text);
62+
#endif
6163
std::string data_;
6264
int display_width_{-1}; // -1 refers to no setting
6365
};

0 commit comments

Comments
 (0)