Re: PB 6.10 beta 5 #PB_Any return value type changed?
Posted: Sat Feb 10, 2024 7:02 pm
It's not the PB Integer type, i know that, all my code is x64/x86 compatible since very long ago.
It's a particular case i came along that made me notice this:
I am interacting with the WebView2 javascript, when you pass in a gadget handle returned by #PB_Any to a js function, it's interpreted differently by javascript depending on the PB linker used:
New Linker: The value becames #VT_R8 (8 bytes floating point)
Old Linker: The value becames #VT_I4 (4 bytes signed)
These causes some issues because i'm passing the value back to PB via libffi so the PB function value has to be declared with the correct type depending on the os.
The workaround is to convert all VT_I4 types to VT_R8 when calling a PB function from javascript and declare them as doubles, it works but i was wondering if it would make more sense to have the same memory behaviour in all os. Anyways my problem is fixed.
It's a particular case i came along that made me notice this:
I am interacting with the WebView2 javascript, when you pass in a gadget handle returned by #PB_Any to a js function, it's interpreted differently by javascript depending on the PB linker used:
New Linker: The value becames #VT_R8 (8 bytes floating point)
Old Linker: The value becames #VT_I4 (4 bytes signed)
These causes some issues because i'm passing the value back to PB via libffi so the PB function value has to be declared with the correct type depending on the os.
The workaround is to convert all VT_I4 types to VT_R8 when calling a PB function from javascript and declare them as doubles, it works but i was wondering if it would make more sense to have the same memory behaviour in all os. Anyways my problem is fixed.