| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows statically linking vc++ runtime dependencies inside libusb-1.0
Windows libraries.
'Release' and 'Debug' configurations produce /MD compiled binaries while
the new 'Release-MT' and 'Debug-MT" configurations produce /MT compiled
binaries.
The /MT flag causes the application to include the multithread, static
version of the vc++ run-time library, whereas the default flag /MD will
cause the vc++ run-time library to be dynamically linked run-time. Using
/MT thus builds a standalone libusb DLL that doesn't require a vc++
runtime DLL to be shipped along with it.
For the official description of /MT see:
https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
Closes #1188
|
|
|
|
|
|
|
|
|
|
|
| |
The __func__ macro is defined by the C99 standard (but not C++99/03).
The default C compiler in msvc implements C89, plus Microsoft extensions,
some of which are part of C99.
It appears that both vs2013 and vs2015 don't define __func__.
Closes #1170
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor common settings into .props files. Enables building full
PlatformToolset, Platform, Configuration matrix easily.
Also update the appveyor file. Technically we no longer need different
images (could just have a single vs2022 image which is executed multiple
times in parallel, or so)
Closes #1116
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Highlights for this change:
- usbi_default_context is only set if libusb_init() is called with NULL.
- All hotplug related functionality (e.g. initialization, processing) has been
moved to hotplug.c
- Backends are simplified by removing initialization mutexes. Mutual exclusion
between init()/exit() is provided by default_context_lock.
- Make hotplug types and functions part of libusbi.h with the common usbi_
prefixes (removes hotplug.h).
Addresses issue highlighted in #855
Closes #856
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
|
|
|
|
|
|
|
| |
Closes #812
Closes #813
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
| |
Closes #151
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are certain games played in the examples and tests source to
account for differences in build environments and target platforms. This
can be simplified by including config.h and using the definitions there.
To that end, move the printf function attribute definition from
libusbi.h to config.h and leverage it where it is used in the examples
and tests.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The split between events and threads abstractions is unnecessary.
Simplify the library by merging the two into a "platform" abstraction.
The only meaningful change is that Cygwin builds will no longer use the
POSIX threads abstraction but will instead use the native Windows one.
The downside to doing this is that the dpfp_threaded example program
will no longer be available on Cygwin builds. This should be fine, and
future work will make dpfp_threaded available for all forms of Windows
build systems.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way in which system handles or resources are represented differs
greatly between Unix-like operating systems and Windows. Ever since
Windows support was added to libusb, Windows been emulating principles
of Unix-like operating systems such as file descriptors and poll().
This commit introduces an abstraction layer that completely removes the
need to perform any emulation. Fundamentally there are three things that
each platform provides to libusb:
1) A signallable event
2) A timer (not required, but useful)
3) A means to wait for event sources such as the above to be triggered
The POSIX abstraction for Unix-like operating systems uses file
descriptors as the "handles" to the underlying system resources. The
signallable event is implemented using a pipe, the timer as a timerfd
(where supported) and the poll() system call is used to wait for events.
The Windows abstraction uses native HANDLEs as the "handles" to the
underlying system resources. The signallable event is implemented using
a manual-reset event, the timer as a manual-reset waitable timer, and
the WaitForMultipleObjects() system call is used to wait for events.
Closes #252
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C11 compiler support has been available for many years now. It is not
unreasonable to require this now, and doing so allows some cleanup to
the configure script. It is no longer necessary to check for compiler
support of the '-fvibility' flag because any compiler that supports C11
will support this flag as well.
Fix up the way that compiler and linker flags are passed down to the
various makefiles. The compiler flags should be shared by all, but the
linker flags and libraries should be separated between the library and
the examples/tests. The visibility flag is only relevant for the
library and the thread flags are only relevant for sources using thread
constructs, so provide them as needed.
Rearrange configure.ac to group similar functionality and consolidate
where possible.
Based on these changes, update the Travis configuration file to include
newer versions of test platforms to ensure proper C11 compiler support.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
| |
These symbols are no longer necessary for the source code since commit
cad7d0edd9 ("core: Kill usbi_os_backend structure definition madness").
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Commit 07d6d3a2a5 ("msvc: Reorder solution projects and add project
filter files") moved the getopt source into the msvc directory but did
not include updating the include paths for the project that needs the
header files.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since Visual Studio picks the first project as the default startup
project, move the library projects back to the top of the list. This use
to be the order but was changed in commit 9843b689df.
Add the project filter files to help organize the source files within
the Solution Explorer window pane.
Additionally move the getopt source underneath the msvc directory since
it is only used for Visual Studio builds.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Older versions of the Visual Studio compiler are picky about macros
constructed with the 'do { ... } while (0)' construct. Convert these
internal ones to static inline functions. The result is functionally
equivalent but gets us type checking and a bit more readability.
Also address some compiler warnings due to some header files that are
being included in a different order than before.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
| |
Closes #683
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the formatting consistent across the entire file. In particular:
- Always quote strings whose values are derived
- Use tabs consistently
- Wrap all arguments with square brackets
Replace the use of '-a' with '&&' to be more portable.
Rearrange some of the feature checks to be conditional upon the platform
or backend. For example, there is no need to check for nfds_t on Windows
because poll() doesn't exist there. Similarly we now only check for
timerfd on Linux and Solaris. This translates into slightly faster
configure times.
Explicitly define tokens for both the poll and thread implementations.
This makes the preprocessor conditionals much nicer since it is not
necessary to enumerate all possible OS_* tokens. Also replace
POLL_NFDS_TYPE with a proper typedef that is based on the availability
of the nfds_t type.
Migrate to config definition names that are more consistent with
autoconf. The check for timerfd actually verifies the presence of the
library function instead of just the header definitions, and the token
USBI_TIMERFD_AVAILABLE is now HAVE_TIMERFD. Similarly the check for
syslog results in a definition of HAVE_SYSLOG.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor libusbi.h to include the set of common header files needed by
every main source file in the library and change these source files to
include libusbi.h first, followed by any non-common headers. Including
libusbi.h first ensures that the config definitions are pulled in and
will eliminate redundant includes in the individual sources files.
Also clean up some whitespace errors and remove unnecessary definitions
in the manually generated config.h files.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
| |
XP is nearly 20 years old and there are hoops we jump through to keep
supporting it. Time to say goodbye and simplify some things.
Closes #267
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit a9b34d170a ("Adding support for ARM & ARM64 Windows Platform")
introduced a dependency on a particular version of the Windows 10 SDK
for *all* platforms. This is particularly annoying for most users who
will only be building for Windows. Fix this by specifying the SDK
dependency only for the ARM/ARM64 platforms and bump to the latest.
Commit 77037c4dd6 ("Adds /utf-8 to compile options") added this compiler
option to all versions of the Visual Studio project files. This results
in a number of warnings with the older versions that don't recognize
this option. Fix this by keeping this option only for 2015 and newer.
Explicitly specify library dependencies for non-static targets. With a
small change in the UsbDk backend we can completely remove all
depenencies other than kernel32.lib.
Lastly, remove the 'MinimalRebuild' option for 2015 and newer project
files as this option is now deprecated and results in a warning for each
project.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
There appears to be no need for the WinCE backend anymore, and it is
increasingly difficult to keep healthy as the rest of the library
changes.
Require at least Visual Studio 2013 to compile. This simplifies matters
as there is some semblance of C99 support there.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
|
|
| |
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
|
|
|
|
| |
Closes #423
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
For simplicity and to address some build warnings, this commit reworks
the project files to eliminate duplication and consolidate common build
flags and options. Also adds the stress and testlibusb projects to the
DDK build script.
Closes #402
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sub-directory created to store the generated files and build objects
was not being used as intended, because each invocation of the bash
starts in the home directory. Fix this by changing to the intended
directory prior to each command invocation.
Also replace the invocation of autogen.sh with bootstrap.sh, since using
autogen.sh calls ./configure and we weren't using the results of that
work. Instead we call configure directly from the sub-directory while
enabling the examples and test builds (for Cygwin) as autogen.sh would do.
Also fix the invalid value for the --build option provided to the x64
build of MinGW.
Finally, propagate errors from each script command so that failures are
caught and reported.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
| |
Previous patch introduced run-time UsbDk backend activation,
therefore separate build configuration is not needed anymore.
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit unifies the two Windows backends into a single project and
enables the user to switch to the UsbDk backend, if available, using the
libusb_set_option() function. All contexts will use the WinUSB backend
by default for backwards compatibility.
With this change, the UsbDk-specific projects are no longer required.
Closes #309
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
| |
Add missing header files, fix preprocessor definitions for static
library, and sort projects and files by name.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
|
| |
Inspired by PR #201 (commit fa19c152), this commit adds the same project
files for the other supported versions of Visual Studio.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
|
|
| |
Closes #201
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
|
| |
* Closes #193
|
|
|
|
|
|
|
|
|
|
|
| |
- Changes in platform configuration, x86 breaks the build
- Solution file does not contain platform for Any CPU,fixing it to Win32
- Added Multiple solutions to appveyor configuration file
- Added batch script for VS2010 builds
- Added fixes to appveyor.bat file and appveyor.yml
- Fixes for Platform and Configuration in appveyor.bat
- Fixed windows exit code, Appveyor reports exit on succesful build
- Multiple Builds in same platform and configuration,fixed it
|
|
|
|
|
|
|
|
|
| |
This commit sorts the source and header files by name (for easier
human parsing), adds windows_nt_common.c to the 2010 and 2012
projects, and removes some CPP defines that should not be present
in the libusb_static_2015.vcxproj file.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|