Skip to content

Commit 0ebe9f1

Browse files
authored
Merge pull request #2385 from mgreter/bugfix/compiler-compat
Improve C++ compiler compatibility
2 parents 77cdab7 + e497f4f commit 0ebe9f1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/functions.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,14 @@ namespace Sass {
318318
if (
319319
special_number(Cast<String_Constant>(env["$alpha"]))
320320
) {
321-
return SASS_MEMORY_NEW(String_Constant, pstate, "rgba("
322-
+ std::to_string((int)c_arg->r())
323-
+ ", "
324-
+ std::to_string((int)c_arg->g())
325-
+ ", "
326-
+ std::to_string((int)c_arg->b())
327-
+ ", "
328-
+ env["$alpha"]->to_string()
329-
+ ")"
330-
);
321+
std::stringstream strm;
322+
strm << "rgba("
323+
<< (int)c_arg->r() << ", "
324+
<< (int)c_arg->g() << ", "
325+
<< (int)c_arg->b() << ", "
326+
<< env["$alpha"]->to_string()
327+
<< ")";
328+
return SASS_MEMORY_NEW(String_Constant, pstate, strm.str());
331329
}
332330

333331
Color_Ptr new_c = SASS_MEMORY_COPY(c_arg);

0 commit comments

Comments
 (0)