Yes, adding the cdecl fixed it, thanks!
I've also added the conversion to miliseconds, now with the extra precision, everything works exactly as in windows
I just find it strange that the function could not be found anywhere in fpc units, not even in macosall.pp