Closed gvanem closed 2 years ago
Who in his right mind would set stdcall globally for a C compiler? I merged LIBUSB_CALL to avoid any confusion in libairspyhf, but something else will likely break elsewhere.
Who in his right mind would set stdcall globally for a C compiler?
Not me. Look at the libusb header for the details: https://github.com/libusb/libusb/blob/master/libusb/libusb.h#L98
And:
- The one consideration that you must apply in your software is to mark
- all functions which you use as libusb callbacks with this LIBUSB_CALL
- annotation, so that they too get compiled for the correct calling
- convention.
Whatever works.
When building with clang-cl and for 32-bit (
x86
), there is this important warning:No warning in 64-bit mode since
stdcall == cdecl
AFAIK. Ref: https://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_x64_calling_conventionBut with this patch, there's no warning in 32-bit mode: