次のようなcコードがあります。
extern "C" __declspec(dllexport) inline sfVector2f __cdecl sf_vector_create(
float x, float y
) {
std::cout << "x: " << x << " y: " << y << std::endl;
sfVector2f vec = {x,y}; // just a struct of two floats
return vec;
}
extern "C" __declspec(dllexport) inline void __cdecl test(
sfSprite* sprite, sfVector2f wtf
) {
std::cout << wtf.x << " " << wtf.y << std::endl;
sfSprite_setPosition(sprite, wtf);
}
次のように reds から呼び出します。
vec: sf-vector-create as float32! float32 として 100.0! 100.0 test mario-sprite vec
これを赤で呼び出すと、文字化けした結果が得られます...なぜですか?