diff --git a/cpp/open3d/utility/Helper.h b/cpp/open3d/utility/Helper.h index c1e6a7b1a69..eea200bc56c 100644 --- a/cpp/open3d/utility/Helper.h +++ b/cpp/open3d/utility/Helper.h @@ -176,7 +176,7 @@ template inline std::string FastFormatString(const std::string& format, Args... args) { #ifdef _WIN32 return FormatString(format, &args...); -#endif // _WIN32 +#else char* buffer = nullptr; int size_s = asprintf(&buffer, format.c_str(), args...); if (size_s == -1) { @@ -186,6 +186,7 @@ inline std::string FastFormatString(const std::string& format, Args... args) { buffer + size_s); // no + 1 since we ignore the \0 std::free(buffer); // asprintf calls malloc return ret; +#endif // _WIN32 }; void Sleep(int milliseconds);