11 Commits
Author SHA1 Message Date
Chris Dickens 9d23ed25b4 build: Fix Android and Xcode compilation errors/warnings
Commit f69548c3b3 ("examples: Enable all examples to build on all
platforms") modified dpfp and sam3u_benchmark to be buildable on any
platform, however there were some oversights and regressions introduced
for Android and Xcode.

Update the Android and Xcode build files to account for the removal of
dpfp_threaded.c as well as the inclusion of config.h from examples
and/or tests source.

Additionally switch the threaded version of dpfp to use sem_open()
instead of sem_init() as the latter is in fact deprecated on MacOS.

Closes #808

Signed-off-by: Chris Dickens <[email protected]>
2020-11-16 13:03:52 -08:00
Chris Dickens d67eb5beaa core: Introduce platform events abstraction
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 <[email protected]>
2020-08-12 16:06:38 -07:00
Chris Dickens 09d0312fbb Xcode: Update project file
Add '-fvisibility=hidden' to the additional compiler flags of the libusb
target so that internal library symbols are hidden.

Add '-pthread' to the additional compiler flags of the targets that
directly use pthread functionality

Add the 'sam3u_benchmark' and 'testlibusb' targets so that all examples
are now built and fix build warnings that occur when building
'sam3u_benchmark'.

Fix target dependencies so that all targets are able to build without
issues.

Signed-off-by: Chris Dickens <[email protected]>
2020-03-30 16:53:43 -07:00
Ludovic Rousseau 4bf9c34359 Xcode: add tests/stress target
Also build tests/stress
2019-11-01 16:45:50 +01:00
Ludovic Rousseau 93b0ed5789 Xcode: apply suggested changes from Xcode 11.2
Enable code signing.
2019-11-01 16:43:45 +01:00
Ludovic Rousseau 0c4f65ab0c Xcode: apply suggested changes from Xcode 10.3 2019-09-15 17:52:38 +02:00
Sean McBride 0aeb46c3dd Fixed Xcode 10.1 warning by setting project setting 'ALWAYS_SEARCH_USER_PATHS = NO'
The warning was: "Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO."

Also made sure all targets are referencing the xcconfig files.

Closes #532

Signed-off-by: Nathan Hjelm <[email protected]>
2019-04-04 21:20:48 -06:00
Sean McBride 6bd5658dd7 darwin: Configure Xcode project to specify tab/space, indent amount
All source files are now tagged as using tabs of 4 spaces, except
darwin_usb.c and darwin_usb.h which use spaces of 2 spaces. This allows
editing files in Xcode without it messing up any particular files.

Signed-off-by: Chris Dickens <[email protected]>
2018-01-08 10:25:13 -08:00
Ludovic Rousseau 79cc25a0a0 darwin: build hotplugtest sample in Xcode
The Xcode project now also builds the hotplugtest (from examples/hotplugtest.c)
target.
2016-03-06 13:37:14 +01:00
Ludovic Rousseau 58bf25b274 darwin: change Xcode project end-of-line
The end of line character was CR (0x0D) instead of NL (0x0A).

It looks like the mistake is from
1eff220474
2015-01-25 13:56:16 +01:00
[email protected] 1eff220474 Misc: Revert all references to libusb/libusb.info 2014-01-08 23:51:01 +00:00