Skip to content

Commit cbf9ef9

Browse files
Antonio Ospitezarvox
authored andcommitted
libusbemu: fix missing int types when compiling under mingw
Fix errors like: platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint8_t’ has not been declared platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint8_t’ has not been declared platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint16_t’ has not been declared platform/windows/libusb10emu/libusb-1.0/libusb.h:69: error: ‘uint16_t’ has not been declared ... Unfortunately it looks like not all Visual Studio versions provide stdint.h, so hack around them. Signed-off-by: Antonio Ospite <[email protected]>
1 parent 87f61ea commit cbf9ef9

File tree

1 file changed

+7
-0
lines changed
  • platform/windows/libusb10emu/libusb-1.0

1 file changed

+7
-0
lines changed

platform/windows/libusb10emu/libusb-1.0/libusb.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636

3737
#include <unistd.h>
3838

39+
#if defined(_MSC_VER)
40+
typedef unsigned __int8 uint8_t;
41+
typedef unsigned __int16 uint16_t;
42+
#else
43+
#include <stdint.h>
44+
#endif
45+
3946
#define LIBUSBEMU 1
4047

4148
// guard to enable mix of compiler semantics (C/C++ calling C++);

0 commit comments

Comments
 (0)