diff options
author | Pete Batard <pbatard@gmail.com> | 2010-04-13 23:32:45 +0100 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-04-13 23:32:45 +0100 |
commit | 511f5b9fdf032fc6b3d4b926538705fe96db1d4f (patch) | |
tree | a892839a85f674177475dd49e374a6cc47372bba /libusb/core.c | |
parent | 26a0c962b13088896a91052e78a23303aa085260 (diff) | |
download | libusb-511f5b9fdf032fc6b3d4b926538705fe96db1d4f.tar.gz |
set default calling convention for Windows platform (core)
no calling convention is set on non Windows platforms as using
__attribute__((cdecl)) is source of potential warnings.
Diffstat (limited to 'libusb/core.c')
-rw-r--r-- | libusb/core.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libusb/core.c b/libusb/core.c index 6391bea..d0013ec 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -590,7 +590,7 @@ struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx, * \returns the number of devices in the outputted list, or LIBUSB_ERROR_NO_MEM * on memory allocation failure. */ -API_EXPORTED ssize_t libusb_get_device_list(libusb_context *ctx, +API_EXPORTED ssize_t LIBUSB_API libusb_get_device_list(libusb_context *ctx, libusb_device ***list) { struct discovered_devs *discdevs = discovered_devs_alloc(); @@ -636,7 +636,7 @@ out: * \param list the list to free * \param unref_devices whether to unref the devices in the list */ -API_EXPORTED void libusb_free_device_list(libusb_device **list, +API_EXPORTED void LIBUSB_API libusb_free_device_list(libusb_device **list, int unref_devices) { if (!list) @@ -657,7 +657,7 @@ API_EXPORTED void libusb_free_device_list(libusb_device **list, * \param dev a device * \returns the bus number */ -API_EXPORTED uint8_t libusb_get_bus_number(libusb_device *dev) +API_EXPORTED uint8_t LIBUSB_API libusb_get_bus_number(libusb_device *dev) { return dev->bus_number; } @@ -667,7 +667,7 @@ API_EXPORTED uint8_t libusb_get_bus_number(libusb_device *dev) * \param dev a device * \returns the device address */ -API_EXPORTED uint8_t libusb_get_device_address(libusb_device *dev) +API_EXPORTED uint8_t LIBUSB_API libusb_get_device_address(libusb_device *dev) { return dev->device_address; } @@ -713,7 +713,7 @@ static const struct libusb_endpoint_descriptor *find_endpoint( * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist * \returns LIBUSB_ERROR_OTHER on other failure */ -API_EXPORTED int libusb_get_max_packet_size(libusb_device *dev, +API_EXPORTED int LIBUSB_API libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint) { struct libusb_config_descriptor *config; @@ -762,7 +762,7 @@ API_EXPORTED int libusb_get_max_packet_size(libusb_device *dev, * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist * \returns LIBUSB_ERROR_OTHER on other failure */ -API_EXPORTED int libusb_get_max_iso_packet_size(libusb_device *dev, +API_EXPORTED int LIBUSB_API libusb_get_max_iso_packet_size(libusb_device *dev, unsigned char endpoint) { struct libusb_config_descriptor *config; @@ -798,7 +798,7 @@ API_EXPORTED int libusb_get_max_iso_packet_size(libusb_device *dev, * \param dev the device to reference * \returns the same device */ -API_EXPORTED libusb_device *libusb_ref_device(libusb_device *dev) +API_EXPORTED libusb_device* LIBUSB_API libusb_ref_device(libusb_device *dev) { usbi_mutex_lock(&dev->lock); dev->refcnt++; @@ -811,7 +811,7 @@ API_EXPORTED libusb_device *libusb_ref_device(libusb_device *dev) * causes the reference count to reach zero, the device shall be destroyed. * \param dev the device to unreference */ -API_EXPORTED void libusb_unref_device(libusb_device *dev) +API_EXPORTED void LIBUSB_API libusb_unref_device(libusb_device *dev) { int refcnt; @@ -900,7 +900,7 @@ void usbi_fd_notification(struct libusb_context *ctx) * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_open(libusb_device *dev, libusb_device_handle **handle) +API_EXPORTED int LIBUSB_API libusb_open(libusb_device *dev, libusb_device_handle **handle) { struct libusb_context *ctx = DEVICE_CTX(dev); struct libusb_device_handle *_handle; @@ -964,7 +964,7 @@ API_EXPORTED int libusb_open(libusb_device *dev, libusb_device_handle **handle) * \param product_id the idProduct value to search for * \returns a handle for the first found device, or NULL on error or if the * device could not be found. */ -API_EXPORTED libusb_device_handle *libusb_open_device_with_vid_pid( +API_EXPORTED libusb_device_handle* LIBUSB_API libusb_open_device_with_vid_pid( libusb_context *ctx, uint16_t vendor_id, uint16_t product_id) { struct libusb_device **devs; @@ -1023,7 +1023,7 @@ static void do_close(struct libusb_context *ctx, * * \param dev_handle the handle to close */ -API_EXPORTED void libusb_close(libusb_device_handle *dev_handle) +API_EXPORTED void LIBUSB_API libusb_close(libusb_device_handle *dev_handle) { struct libusb_context *ctx; unsigned char dummy = 1; @@ -1084,7 +1084,7 @@ API_EXPORTED void libusb_close(libusb_device_handle *dev_handle) * \param dev_handle a device handle * \returns the underlying device */ -API_EXPORTED libusb_device *libusb_get_device(libusb_device_handle *dev_handle) +API_EXPORTED libusb_device* LIBUSB_API libusb_get_device(libusb_device_handle *dev_handle) { return dev_handle->dev; } @@ -1109,7 +1109,7 @@ API_EXPORTED libusb_device *libusb_get_device(libusb_device_handle *dev_handle) * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_get_configuration(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_get_configuration(libusb_device_handle *dev, int *config) { int r = LIBUSB_ERROR_NOT_SUPPORTED; @@ -1178,7 +1178,7 @@ API_EXPORTED int libusb_get_configuration(libusb_device_handle *dev, * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_set_configuration(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_set_configuration(libusb_device_handle *dev, int configuration) { usbi_dbg("configuration %d", configuration); @@ -1209,7 +1209,7 @@ API_EXPORTED int libusb_set_configuration(libusb_device_handle *dev, * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns a LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_claim_interface(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_claim_interface(libusb_device_handle *dev, int interface_number) { int r = 0; @@ -1246,7 +1246,7 @@ out: * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_release_interface(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_release_interface(libusb_device_handle *dev, int interface_number) { int r; @@ -1291,7 +1291,7 @@ out: * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_set_interface_alt_setting(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_set_interface_alt_setting(libusb_device_handle *dev, int interface_number, int alternate_setting) { usbi_dbg("interface %d altsetting %d", @@ -1326,7 +1326,7 @@ API_EXPORTED int libusb_set_interface_alt_setting(libusb_device_handle *dev, * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_clear_halt(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_clear_halt(libusb_device_handle *dev, unsigned char endpoint) { usbi_dbg("endpoint %x", endpoint); @@ -1352,7 +1352,7 @@ API_EXPORTED int libusb_clear_halt(libusb_device_handle *dev, * device has been disconnected * \returns another LIBUSB_ERROR code on other failure */ -API_EXPORTED int libusb_reset_device(libusb_device_handle *dev) +API_EXPORTED int LIBUSB_API libusb_reset_device(libusb_device_handle *dev) { usbi_dbg(""); return usbi_backend->reset_device(dev); @@ -1371,7 +1371,7 @@ API_EXPORTED int libusb_reset_device(libusb_device_handle *dev) * \returns another LIBUSB_ERROR code on other failure * \see libusb_detach_kernel_driver() */ -API_EXPORTED int libusb_kernel_driver_active(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_kernel_driver_active(libusb_device_handle *dev, int interface_number) { usbi_dbg("interface %d", interface_number); @@ -1394,7 +1394,7 @@ API_EXPORTED int libusb_kernel_driver_active(libusb_device_handle *dev, * \returns another LIBUSB_ERROR code on other failure * \see libusb_kernel_driver_active() */ -API_EXPORTED int libusb_detach_kernel_driver(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_detach_kernel_driver(libusb_device_handle *dev, int interface_number) { usbi_dbg("interface %d", interface_number); @@ -1419,7 +1419,7 @@ API_EXPORTED int libusb_detach_kernel_driver(libusb_device_handle *dev, * \returns another LIBUSB_ERROR code on other failure * \see libusb_kernel_driver_active() */ -API_EXPORTED int libusb_attach_kernel_driver(libusb_device_handle *dev, +API_EXPORTED int LIBUSB_API libusb_attach_kernel_driver(libusb_device_handle *dev, int interface_number) { usbi_dbg("interface %d", interface_number); @@ -1458,7 +1458,7 @@ API_EXPORTED int libusb_attach_kernel_driver(libusb_device_handle *dev, * \param ctx the context to operate on, or NULL for the default context * \param level debug level to set */ -API_EXPORTED void libusb_set_debug(libusb_context *ctx, int level) +API_EXPORTED void LIBUSB_API libusb_set_debug(libusb_context *ctx, int level) { USBI_GET_CONTEXT(ctx); // ctx can be NULL if called before libusb_init @@ -1475,7 +1475,7 @@ API_EXPORTED void libusb_set_debug(libusb_context *ctx, int level) * Only valid on return code 0. * \returns 0 on success, or a LIBUSB_ERROR code on failure */ -API_EXPORTED int libusb_init(libusb_context **context) +API_EXPORTED int LIBUSB_API libusb_init(libusb_context **context) { char *dbg = getenv("LIBUSB_DEBUG"); struct libusb_context *ctx; @@ -1548,7 +1548,7 @@ err: * before your application terminates. * \param ctx the context to deinitialize, or NULL for the default context */ -API_EXPORTED void libusb_exit(struct libusb_context *ctx) +API_EXPORTED void LIBUSB_API libusb_exit(struct libusb_context *ctx) { USBI_GET_CONTEXT(ctx); usbi_dbg(""); @@ -1642,7 +1642,7 @@ void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, * \param errcode the error code whose description is desired * \returns a short description of the error code in English */ -API_EXPORTED const char* libusb_strerror(enum libusb_error errcode) +API_EXPORTED const char* LIBUSB_API libusb_strerror(enum libusb_error errcode) { switch (errcode) { |