-
-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling convention needed on a few functions #182
Comments
Hi! I'll get to this in a few days (or perhaps a week+). |
I'm puzzled as to why there is a problem for EDIT: actually microsoft state it in their docs about main... but instead of annotating it I'll just ignore the warning there |
@jrouwe actually I just moved away from Try the dev branch and let me know if it's fixed. Not sure when I'll release this in the master branch though... |
Hello, I can confirm that it works. Thanks for the quick fix! Regards, |
I'm compiling my project with the __vectorcall calling convention (/Gv) on MSVC which causes doctest to throw up a few compile errors:
doctest.h(5016): error C2664: 'void qsort(void *,size_t,size_t,_CoreCrtNonSecureSearchSortCompareFunction)': cannot convert argument 4 from 'int (__vectorcall *)(const void *,const void *)' to '_CoreCrtNonSecureSearchSortCompareFunction' doctest.h(5016): note: None of the functions with this name in scope match the target type doctest.h(5018): error C2664: 'void qsort(void *,size_t,size_t,_CoreCrtNonSecureSearchSortCompareFunction)': cannot convert argument 4 from 'int (__vectorcall *)(const void *,const void *)' to '_CoreCrtNonSecureSearchSortCompareFunction' doctest.h(5018): note: None of the functions with this name in scope match the target type doctest.h(5020): error C2664: 'void qsort(void *,size_t,size_t,_CoreCrtNonSecureSearchSortCompareFunction)': cannot convert argument 4 from 'int (__vectorcall *)(const void *,const void *)' to '_CoreCrtNonSecureSearchSortCompareFunction' doctest.h(5020): note: None of the functions with this name in scope match the target type doctest.h(5260): warning C4007: 'main': must be '__cdecl'
To fix them I had to add __cdecl to the functions fileOrderComparator, suiteOrderComparator, nameOrderComparator and main.
I'm only targetting Windows and Linux so this works for me, but I don't believe OS X supports the __cdecl calling convention, so my guess is that it is best to add a macro to specify the default calling convention for those methods.
Regards,
Jorrit.
The text was updated successfully, but these errors were encountered: