diff options
author | Pete Batard <pbatard@gmail.com> | 2011-05-10 00:38:12 +0100 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2011-06-13 22:06:30 +0200 |
commit | c1e75431418cdfc10ec963d823fce479cdae6840 (patch) | |
tree | 08e9d47ae8a980ab78d603a71b41e47fecdb2ecf /libusb/libusb.h | |
parent | 85a14f43e0ce27cd47f84fdaeacbaa81cebdb886 (diff) | |
download | android_external_libusbx-c1e75431418cdfc10ec963d823fce479cdae6840.tar.gz android_external_libusbx-c1e75431418cdfc10ec963d823fce479cdae6840.tar.bz2 android_external_libusbx-c1e75431418cdfc10ec963d823fce479cdae6840.zip |
Windows: MS project files part 1 - support files & preliminaries
* adds the MSVC support files used by MSVC6, VS2005 and WDK
* also adds missing defines required by MS compilers in libusb.h
* also anticipatory sets .gitattributes for CRLF handling
* also adds manually maintained .def file for import lib generation
References #57.
Diffstat (limited to 'libusb/libusb.h')
-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 eb913e4..a34456c 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> |