translate-c-2 floats

This commit is contained in:
Vexu
2019-12-17 11:15:41 +02:00
parent 9cda93a24e
commit daa22d42b0
5 changed files with 74 additions and 8 deletions

View File

@@ -2161,6 +2161,11 @@ unsigned ZigClangAPFloat_convertToHexString(const ZigClangAPFloat *self, char *D
return casted->convertToHexString(DST, HexDigits, UpperCase, (llvm::APFloat::roundingMode)RM);
}
double ZigClangAPFloat_getValueAsApproximateDouble(const ZigClangFloatingLiteral *self) {
auto casted = reinterpret_cast<const clang::FloatingLiteral *>(self);
return casted->getValueAsApproximateDouble();
}
enum ZigClangStringLiteral_StringKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self) {
auto casted = reinterpret_cast<const clang::StringLiteral *>(self);
return (ZigClangStringLiteral_StringKind)casted->getKind();