001-fix-musl-stdint.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. --- a/libusb/usb.h
  2. +++ b/libusb/usb.h
  3. @@ -27,6 +27,7 @@
  4. #include <unistd.h>
  5. #include <stdlib.h>
  6. +#include <stdint.h>
  7. #include <limits.h>
  8. #include <dirent.h>
  9. @@ -78,40 +79,40 @@
  10. /* All standard descriptors have these 2 fields in common */
  11. struct usb_descriptor_header {
  12. - u_int8_t bLength;
  13. - u_int8_t bDescriptorType;
  14. + uint8_t bLength;
  15. + uint8_t bDescriptorType;
  16. };
  17. /* String descriptor */
  18. struct usb_string_descriptor {
  19. - u_int8_t bLength;
  20. - u_int8_t bDescriptorType;
  21. - u_int16_t wData[1];
  22. + uint8_t bLength;
  23. + uint8_t bDescriptorType;
  24. + uint16_t wData[1];
  25. };
  26. /* HID descriptor */
  27. struct usb_hid_descriptor {
  28. - u_int8_t bLength;
  29. - u_int8_t bDescriptorType;
  30. - u_int16_t bcdHID;
  31. - u_int8_t bCountryCode;
  32. - u_int8_t bNumDescriptors;
  33. - /* u_int8_t bReportDescriptorType; */
  34. - /* u_int16_t wDescriptorLength; */
  35. + uint8_t bLength;
  36. + uint8_t bDescriptorType;
  37. + uint16_t bcdHID;
  38. + uint8_t bCountryCode;
  39. + uint8_t bNumDescriptors;
  40. + /* uint8_t bReportDescriptorType; */
  41. + /* uint16_t wDescriptorLength; */
  42. /* ... */
  43. };
  44. /* Endpoint descriptor */
  45. #define USB_MAXENDPOINTS 32
  46. struct usb_endpoint_descriptor {
  47. - u_int8_t bLength;
  48. - u_int8_t bDescriptorType;
  49. - u_int8_t bEndpointAddress;
  50. - u_int8_t bmAttributes;
  51. - u_int16_t wMaxPacketSize;
  52. - u_int8_t bInterval;
  53. - u_int8_t bRefresh;
  54. - u_int8_t bSynchAddress;
  55. + uint8_t bLength;
  56. + uint8_t bDescriptorType;
  57. + uint8_t bEndpointAddress;
  58. + uint8_t bmAttributes;
  59. + uint16_t wMaxPacketSize;
  60. + uint8_t bInterval;
  61. + uint8_t bRefresh;
  62. + uint8_t bSynchAddress;
  63. unsigned char *extra; /* Extra descriptors */
  64. int extralen;
  65. @@ -129,15 +130,15 @@ struct usb_endpoint_descriptor {
  66. /* Interface descriptor */
  67. #define USB_MAXINTERFACES 32
  68. struct usb_interface_descriptor {
  69. - u_int8_t bLength;
  70. - u_int8_t bDescriptorType;
  71. - u_int8_t bInterfaceNumber;
  72. - u_int8_t bAlternateSetting;
  73. - u_int8_t bNumEndpoints;
  74. - u_int8_t bInterfaceClass;
  75. - u_int8_t bInterfaceSubClass;
  76. - u_int8_t bInterfaceProtocol;
  77. - u_int8_t iInterface;
  78. + uint8_t bLength;
  79. + uint8_t bDescriptorType;
  80. + uint8_t bInterfaceNumber;
  81. + uint8_t bAlternateSetting;
  82. + uint8_t bNumEndpoints;
  83. + uint8_t bInterfaceClass;
  84. + uint8_t bInterfaceSubClass;
  85. + uint8_t bInterfaceProtocol;
  86. + uint8_t iInterface;
  87. struct usb_endpoint_descriptor *endpoint;
  88. @@ -155,14 +156,14 @@ struct usb_interface {
  89. /* Configuration descriptor information.. */
  90. #define USB_MAXCONFIG 8
  91. struct usb_config_descriptor {
  92. - u_int8_t bLength;
  93. - u_int8_t bDescriptorType;
  94. - u_int16_t wTotalLength;
  95. - u_int8_t bNumInterfaces;
  96. - u_int8_t bConfigurationValue;
  97. - u_int8_t iConfiguration;
  98. - u_int8_t bmAttributes;
  99. - u_int8_t MaxPower;
  100. + uint8_t bLength;
  101. + uint8_t bDescriptorType;
  102. + uint16_t wTotalLength;
  103. + uint8_t bNumInterfaces;
  104. + uint8_t bConfigurationValue;
  105. + uint8_t iConfiguration;
  106. + uint8_t bmAttributes;
  107. + uint8_t MaxPower;
  108. struct usb_interface *interface;
  109. @@ -172,28 +173,28 @@ struct usb_config_descriptor {
  110. /* Device descriptor */
  111. struct usb_device_descriptor {
  112. - u_int8_t bLength;
  113. - u_int8_t bDescriptorType;
  114. - u_int16_t bcdUSB;
  115. - u_int8_t bDeviceClass;
  116. - u_int8_t bDeviceSubClass;
  117. - u_int8_t bDeviceProtocol;
  118. - u_int8_t bMaxPacketSize0;
  119. - u_int16_t idVendor;
  120. - u_int16_t idProduct;
  121. - u_int16_t bcdDevice;
  122. - u_int8_t iManufacturer;
  123. - u_int8_t iProduct;
  124. - u_int8_t iSerialNumber;
  125. - u_int8_t bNumConfigurations;
  126. + uint8_t bLength;
  127. + uint8_t bDescriptorType;
  128. + uint16_t bcdUSB;
  129. + uint8_t bDeviceClass;
  130. + uint8_t bDeviceSubClass;
  131. + uint8_t bDeviceProtocol;
  132. + uint8_t bMaxPacketSize0;
  133. + uint16_t idVendor;
  134. + uint16_t idProduct;
  135. + uint16_t bcdDevice;
  136. + uint8_t iManufacturer;
  137. + uint8_t iProduct;
  138. + uint8_t iSerialNumber;
  139. + uint8_t bNumConfigurations;
  140. };
  141. struct usb_ctrl_setup {
  142. - u_int8_t bRequestType;
  143. - u_int8_t bRequest;
  144. - u_int16_t wValue;
  145. - u_int16_t wIndex;
  146. - u_int16_t wLength;
  147. + uint8_t bRequestType;
  148. + uint8_t bRequest;
  149. + uint16_t wValue;
  150. + uint16_t wIndex;
  151. + uint16_t wLength;
  152. };
  153. /*
  154. @@ -254,7 +255,7 @@ struct usb_device {
  155. void *dev; /* Darwin support */
  156. - u_int8_t devnum;
  157. + uint8_t devnum;
  158. unsigned char num_children;
  159. struct usb_device **children;
  160. @@ -266,7 +267,7 @@ struct usb_bus {
  161. char dirname[PATH_MAX + 1];
  162. struct usb_device *devices;
  163. - u_int32_t location;
  164. + uint32_t location;
  165. struct usb_device *root_dev;
  166. };