This will test the coz library and make sure it is linkable and
the resulting binary is runnable.
This test detects a problem with GCC 6 when combined with clang that
is missing with 4.9.
Make sure to initialize coz if pthread_create() is called before main().
This happend with openalpr when a shared library initialized a thread
in the library initialization code.
Fixes issue #54
GCC 6 complains with "sorry, unimplemented: non-trivial designated
initializers not supported/" for the original struct initializers.
Rewrite code to clear structs and assign individual members instead.
The designated initializers feature is only part of standard C, not
(at least not yet) part of standard C++.
The type of copy_from_ring_buffer's index argument was inconsistent
between the function's prototype and definition. Emery suggested using
ptrdiff_t rather than size_t, as index represents a memory offset rather
than a size.
We need to include cstddef for ptrdiff_t, so I added that as well.
The prototype declares index as a size_t while the definition declares
it as a uint64_t. If I understand correctly, it's used a memory offset,
so size_t seems preferable.
This causes a build failure with Clang 3.4 on Ubuntu 14.04.3 LTS.