diff options
author | Pete Batard <pbatard@gmail.com> | 2010-11-18 12:24:37 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-11-18 12:24:37 +0000 |
commit | 727bb1d499607694b66287618a85c8f3b44e9f30 (patch) | |
tree | 8a78276c61b95e09670a647bf0b171e5dfb65661 /libusb | |
parent | fa4cd28da39f2398d178ab4a1a55bfc8fba395d6 (diff) | |
download | libusb-727bb1d499607694b66287618a85c8f3b44e9f30.tar.gz |
removed dependency on stdint.h for MS binary snapshot users
* binary snapshot users, with a version of Visual Studio < 10
don't have stdint.h available
* stdint.h is referenced in libusb.h
* ssize_t, uint8_t and uint16_t are now defined in libusb.h
when required
Diffstat (limited to 'libusb')
-rw-r--r-- | libusb/libusb.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libusb/libusb.h b/libusb/libusb.h index d46c68b..72917ca 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -21,12 +21,29 @@ #ifndef __LIBUSB_H__ #define __LIBUSB_H__ -/* MSVC doesn't like inline, but does accept __inline ?? */ #ifdef _MSC_VER +/* on MS environments, the inline keyword is available in C++ only */ #define inline __inline +/* ssize_t is also not available (copy/paste from MinGW) */ +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#undef ssize_t +#ifdef _WIN64 + typedef __int64 ssize_t; +#else + typedef int ssize_t; +#endif /* _WIN64 */ +#endif /* _SSIZE_T_DEFINED */ +#endif /* _MSC_VER */ + +/* stdint.h is also not usually available on MS */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H)) +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +#else +#include <stdint.h> #endif -#include <stdint.h> #include <sys/types.h> #include <time.h> #include <limits.h> |