hidapi: mark libusb function pointers with LIBUSB_CALL.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c
index 3929572..a725c58 100644
--- a/src/hidapi/SDL_hidapi.c
+++ b/src/hidapi/SDL_hidapi.c
@@ -691,33 +691,33 @@ static struct
{
void* libhandle;
- int (*init)(libusb_context **ctx);
- void (*exit)(libusb_context *ctx);
- ssize_t (*get_device_list)(libusb_context *ctx, libusb_device ***list);
- void (*free_device_list)(libusb_device **list, int unref_devices);
- int (*get_device_descriptor)(libusb_device *dev, struct libusb_device_descriptor *desc);
- int (*get_active_config_descriptor)(libusb_device *dev, struct libusb_config_descriptor **config);
- int (*get_config_descriptor)(
+ int (LIBUSB_CALL *init)(libusb_context **ctx);
+ void (LIBUSB_CALL *exit)(libusb_context *ctx);
+ ssize_t (LIBUSB_CALL *get_device_list)(libusb_context *ctx, libusb_device ***list);
+ void (LIBUSB_CALL *free_device_list)(libusb_device **list, int unref_devices);
+ int (LIBUSB_CALL *get_device_descriptor)(libusb_device *dev, struct libusb_device_descriptor *desc);
+ int (LIBUSB_CALL *get_active_config_descriptor)(libusb_device *dev, struct libusb_config_descriptor **config);
+ int (LIBUSB_CALL *get_config_descriptor)(
libusb_device *dev,
uint8_t config_index,
struct libusb_config_descriptor **config
);
- void (*free_config_descriptor)(struct libusb_config_descriptor *config);
- uint8_t (*get_bus_number)(libusb_device *dev);
- uint8_t (*get_device_address)(libusb_device *dev);
- int (*open)(libusb_device *dev, libusb_device_handle **dev_handle);
- void (*close)(libusb_device_handle *dev_handle);
- int (*claim_interface)(libusb_device_handle *dev_handle, int interface_number);
- int (*release_interface)(libusb_device_handle *dev_handle, int interface_number);
- int (*kernel_driver_active)(libusb_device_handle *dev_handle, int interface_number);
- int (*detach_kernel_driver)(libusb_device_handle *dev_handle, int interface_number);
- int (*attach_kernel_driver)(libusb_device_handle *dev_handle, int interface_number);
- int (*set_interface_alt_setting)(libusb_device_handle *dev, int interface_number, int alternate_setting);
- struct libusb_transfer * (*alloc_transfer)(int iso_packets);
- int (*submit_transfer)(struct libusb_transfer *transfer);
- int (*cancel_transfer)(struct libusb_transfer *transfer);
- void (*free_transfer)(struct libusb_transfer *transfer);
- int (*control_transfer)(
+ void (LIBUSB_CALL *free_config_descriptor)(struct libusb_config_descriptor *config);
+ uint8_t (LIBUSB_CALL *get_bus_number)(libusb_device *dev);
+ uint8_t (LIBUSB_CALL *get_device_address)(libusb_device *dev);
+ int (LIBUSB_CALL *open)(libusb_device *dev, libusb_device_handle **dev_handle);
+ void (LIBUSB_CALL *close)(libusb_device_handle *dev_handle);
+ int (LIBUSB_CALL *claim_interface)(libusb_device_handle *dev_handle, int interface_number);
+ int (LIBUSB_CALL *release_interface)(libusb_device_handle *dev_handle, int interface_number);
+ int (LIBUSB_CALL *kernel_driver_active)(libusb_device_handle *dev_handle, int interface_number);
+ int (LIBUSB_CALL *detach_kernel_driver)(libusb_device_handle *dev_handle, int interface_number);
+ int (LIBUSB_CALL *attach_kernel_driver)(libusb_device_handle *dev_handle, int interface_number);
+ int (LIBUSB_CALL *set_interface_alt_setting)(libusb_device_handle *dev, int interface_number, int alternate_setting);
+ struct libusb_transfer * (LIBUSB_CALL *alloc_transfer)(int iso_packets);
+ int (LIBUSB_CALL *submit_transfer)(struct libusb_transfer *transfer);
+ int (LIBUSB_CALL *cancel_transfer)(struct libusb_transfer *transfer);
+ void (LIBUSB_CALL *free_transfer)(struct libusb_transfer *transfer);
+ int (LIBUSB_CALL *control_transfer)(
libusb_device_handle *dev_handle,
uint8_t request_type,
uint8_t bRequest,
@@ -727,7 +727,7 @@ static struct
uint16_t wLength,
unsigned int timeout
);
- int (*interrupt_transfer)(
+ int (LIBUSB_CALL *interrupt_transfer)(
libusb_device_handle *dev_handle,
unsigned char endpoint,
unsigned char *data,
@@ -735,8 +735,8 @@ static struct
int *actual_length,
unsigned int timeout
);
- int (*handle_events)(libusb_context *ctx);
- int (*handle_events_completed)(libusb_context *ctx, int *completed);
+ int (LIBUSB_CALL *handle_events)(libusb_context *ctx);
+ int (LIBUSB_CALL *handle_events_completed)(libusb_context *ctx, int *completed);
} libusb_ctx;
#define libusb_init libusb_ctx.init