Fix Sprintf problem

test=develop
revert-15207-remove_op_handle_lock_and_fix_var
minqiyang 6 years ago
parent 010f657b33
commit 52b4821a6e

@ -261,7 +261,7 @@ inline void throw_on_error(T e) {
#define __PADDLE_THROW_ERROR_I(_, _9, _8, _7, _6, _5, _4, _3, _2, X_, ...) X_;
#define __THROW_ON_ERROR_ONE_ARG(COND, ARG) \
::paddle::platform::throw_on_error(COND, "%s", std::string(ARG));
::paddle::platform::throw_on_error(COND, ::paddle::string::Sprintf(ARG));
#define __PADDLE_THROW_ON_ERROR(COND, ...) \
__PADDLE_THROW_ERROR_I( \

@ -87,7 +87,7 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) {
template <typename... Args>
std::string Sprintf(const Args&... args) {
std::ostringstream oss;
Fprintf(oss, "");
Fprintf(oss, "%s", args...);
return oss.str();
}

Loading…
Cancel
Save