#endif
#ifndef FXLOAD_VERSION
-#define FXLOAD_VERSION (__DATE__ " (development)")
+#define FXLOAD_VERSION (__DATE__ " (libusbx)")
#endif
#ifndef ARRAYSIZE
*/
#include <stdio.h>
-#if !defined(_WIN32_WCE)
-#include <sys/types.h>
-#endif
#include "libusb.h"
#define msleep(msecs) usleep(1000*msecs)
#endif
-#if !defined(_MSC_VER) || _MSC_VER<=1200 || defined(_WIN32_WCE)
-#define sscanf_s sscanf
-#endif
-
#if !defined(bool)
#define bool int
#endif
#define false (!true)
#endif
-
// Future versions of libusbx will use usb_interface instead of interface
// in libusb_config_descriptor => catter for that
#define usb_interface interface
break;
}
if (i != arglen) {
- if (sscanf_s(argv[j], "%x:%x" , &tmp_vid, &tmp_pid) != 2) {
+ if (sscanf(argv[j], "%x:%x" , &tmp_vid, &tmp_pid) != 2) {
printf(" Please specify VID & PID as \"vid:pid\" in hexadecimal format\n");
return 1;
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#if defined(OS_WINCE)
-#include "missing.h" // getenv()
-#endif
-
#include "libusbi.h"
+#ifdef HAVE_MISSING_H
+#include "missing.h"
+#endif
#if defined(OS_LINUX)
const struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend;
#include <stdlib.h>
#include <string.h>
#include <time.h>
-
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
-
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-
#ifdef USBI_TIMERFD_AVAILABLE
#include <sys/timerfd.h>
#endif
#endif /* _SSIZE_T_DEFINED */
#endif /* _MSC_VER */
-/* stdint.h is also not usually available on MS */
+/* stdint.h is not available on older MSVC */
#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H))
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
#if !defined(_WIN32_WCE)
#include <sys/types.h>
#endif
-#include <time.h>
-#include <limits.h>
#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
#include <sys/time.h>
#endif
+#include <time.h>
+#include <limits.h>
+
/* 'interface' might be defined as a macro on Windows, so we need to
* undefine it so as not to break the current libusbx API, because
* libusb_config_descriptor has an 'interface' member
#if defined(interface)
#undef interface
#endif
-#if defined(_WIN32_WCE)
-// Needed for "struct timeval" definition
-#include <winsock2.h>
+#if !defined(__CYGWIN__)
+#include <winsock.h>
#endif
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
-#ifdef DDKBUILD
-#include <winsock.h> // needed for struct timeval for WDK
-#endif
#include "libusb.h"
#include "version.h"
#include <stdio.h>
#include <stdlib.h>
-#include <libusbi.h>
+#include "libusbi.h"
// Uncomment to debug the polling layer
//#define DEBUG_POLL_WINDOWS
#define DLL_LOAD(dll, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, name, name, ret_on_failure)
#define DLL_DECLARE_PREFIXED(api, ret, prefix, name, args) DLL_DECLARE_PREFIXNAME(api, ret, prefix##name, name, args)
#define DLL_LOAD_PREFIXED(dll, prefix, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, prefix##name, name, ret_on_failure)
-
#include <objbase.h>
#include <winioctl.h>
-#include <libusbi.h>
+#include "libusbi.h"
#include "poll_windows.h"
#include "windows_usb.h"
-#define LIBUSB_NANO 10620
+#define LIBUSB_NANO 10621
/* Default visibility */
#define DEFAULT_VISIBILITY /**/
-/* Start with debug message logging enabled */
-//#define ENABLE_DEBUG_LOGGING 1
-
-/* Message logging */
+/* Enable global message logging */
#define ENABLE_LOGGING 1
+/* Uncomment to start with debug message logging enabled */
+// #define ENABLE_DEBUG_LOGGING 1
+
+/* type of second poll() argument */
+#define POLL_NFDS_TYPE unsigned int
+
/* Windows/WinCE backend */
#if defined(_WIN32_WCE)
#define OS_WINCE 1
+#define HAVE_MISSING_H
#else
#define OS_WINDOWS 1
-#endif
-
-/* type of second poll() argument */
-#define POLL_NFDS_TYPE unsigned int
-
-#if !defined(_WIN32_WCE)
-
-/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
-
-#endif
\ No newline at end of file
+#endif
/* 35 - Unknown Error */
#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
#define EDEADLK 36
+#if 0
/* 37 - Unknown Error */
#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
#define ENOLCK 39 /* No locks available (46 in Cyg?) */
#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
#define EILSEQ 42 /* Illegal byte sequence */
+#endif
/*
* NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the
#include <stdio.h>
#include <memory.h>
-#if !defined(_WIN32_WCE)
-#include <sys/types.h>
-#endif
#include "libusb.h"
-
#include "libusbx_testlib.h"
/** Test that creates and destroys a single concurrent context