Skip to content

Commit f2769f6

Browse files
committed
[runtime] Make Float32Utils.f32() work on C# target
1 parent 747f379 commit f2769f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

runtime/src/ceramic/Float32Utils.hx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class Float32Utils {
7272
}
7373
return Context.parse("(untyped __cpp__('" + exprStr + "f'):ceramic.Float32)", Context.currentPos());
7474
}
75+
else if (Context.defined('cs')) {
76+
var exprStr = new Printer().printExpr(expr);
77+
if (exprStr.indexOf('.') == -1) {
78+
exprStr += '.0';
79+
}
80+
return Context.parse("(untyped __cs__('" + exprStr + "f'):ceramic.Float32)", Context.currentPos());
81+
}
7582
else {
7683
return expr;
7784
}

0 commit comments

Comments
 (0)