some reading kref_kotlin troubles on C++ side, strange values in varables

77 views Asked by At

I've built the native kotlin library for Android Arm64 target, kotlin generated *.h and *.so. files, added these files to Android project and tried to create kref_values on c++ side by default h-file kotlin functions:

mylib_ExportedSymbols* symbols = mylib_symbols();
auto kdouble = symbols->createNullableDouble(12345678.88);
if (kdouble.pinned != nullptr) {
    auto val = *(static_cast<double*>)(kdouble.pinned);
    // val has strange value, and it diferents from 12345678.88
    std::cout << "double = " << val << std::endl;
}

kdouble has the type:

typedef struct {
   mylib_KNativePtr pinned;
} mylib_kref_kotlin_Double;

How to read this double if I don't have another appropriate functions in h-file to extract double value from mylib_kref_kotlin_Double type?

Thanks.

0

There are 0 answers