c-rbtree: re-import git-subtree for 'src/c-rbtree'
git subtree pull --prefix src/c-rbtree git@github.com:c-util/c-rbtree.git main --squash
This commit is contained in:
30
src/c-rbtree/.github/workflows/ci.yml
vendored
30
src/c-rbtree/.github/workflows/ci.yml
vendored
@@ -9,25 +9,15 @@ on:
|
||||
jobs:
|
||||
ci:
|
||||
name: CI with Default Configuration
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Fetch Sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Run through C-Util CI
|
||||
uses: c-util/automation/src/ci-c-util@v1
|
||||
with:
|
||||
m32: 1
|
||||
valgrind: 1
|
||||
|
||||
uses: bus1/cabuild/.github/workflows/ci-c-util.yml@v1
|
||||
with:
|
||||
cabuild_ref: "v1"
|
||||
m32: true
|
||||
matrixmode: true
|
||||
valgrind: true
|
||||
ci-ptrace:
|
||||
name: Reduced CI with PTrace
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CRBTREE_TEST_PTRACE: '1'
|
||||
|
||||
steps:
|
||||
- name: Fetch Sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Run through C-Util CI
|
||||
uses: c-util/automation/src/ci-c-util@v1
|
||||
uses: bus1/cabuild/.github/workflows/ci-c-util.yml@v1
|
||||
with:
|
||||
cabuild_ref: "v1"
|
||||
mesonargs: '-Dptrace=true'
|
||||
|
3
src/c-rbtree/.gitmodules
vendored
3
src/c-rbtree/.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "subprojects/c-stdaux"]
|
||||
path = subprojects/c-stdaux
|
||||
url = https://github.com/c-util/c-stdaux.git
|
||||
|
@@ -30,7 +30,7 @@ AUTHORS-LGPL:
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
COPYRIGHT: (ordered alphabetically)
|
||||
Copyright (C) 2015-2019 Red Hat, Inc.
|
||||
Copyright (C) 2015-2022 Red Hat, Inc.
|
||||
|
||||
AUTHORS: (ordered alphabetically)
|
||||
David Rheinsberg <david.rheinsberg@gmail.com>
|
||||
|
@@ -1,5 +1,20 @@
|
||||
# c-rbtree - Intrusive Red-Black Tree Collection
|
||||
|
||||
## CHANGES WITH 4:
|
||||
|
||||
* Add 'ptrace' build option to enable running tests using 'ptrace'
|
||||
to verify extended execution properties. This option should not
|
||||
be used in setups where 'ptrace' cannot be employed (like running
|
||||
under gdb or valgrind). This option only affects the test-suite.
|
||||
|
||||
* meson-0.60.0 is now the minimum required meson version.
|
||||
|
||||
* TBD
|
||||
|
||||
Contributions from: David Rheinsberg
|
||||
|
||||
- TBD, YYYY-MM-DD
|
||||
|
||||
## CHANGES WITH 3:
|
||||
|
||||
* Add more helpers. Add both a collection of iteratiors and helpers
|
||||
|
@@ -22,7 +22,7 @@ The requirements for this project are:
|
||||
|
||||
At build-time, the following software is required:
|
||||
|
||||
* `meson >= 0.41`
|
||||
* `meson >= 0.60`
|
||||
* `pkg-config >= 0.29`
|
||||
|
||||
### Build
|
||||
|
@@ -1,19 +1,22 @@
|
||||
project(
|
||||
'c-rbtree',
|
||||
'c',
|
||||
version: '3',
|
||||
license: 'Apache',
|
||||
default_options: [
|
||||
'c_std=c11'
|
||||
],
|
||||
license: 'Apache',
|
||||
meson_version: '>=0.60.0',
|
||||
version: '3.0.0',
|
||||
)
|
||||
major = meson.project_version().split('.')[0]
|
||||
project_description = 'Intrusive Red-Black Tree Collection'
|
||||
|
||||
add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||
mod_pkgconfig = import('pkgconfig')
|
||||
use_ptrace = get_option('ptrace')
|
||||
|
||||
sub_cstdaux = subproject('c-stdaux')
|
||||
|
||||
dep_cstdaux = sub_cstdaux.get_variable('libcstdaux_dep')
|
||||
dep_cstdaux = dependency('libcstdaux-1')
|
||||
add_project_arguments(dep_cstdaux.get_variable('cflags').split(' '), language: 'c')
|
||||
|
||||
subdir('src')
|
||||
|
||||
meson.override_dependency('libcrbtree-'+major, libcrbtree_dep, static: true)
|
||||
|
1
src/c-rbtree/meson_options.txt
Normal file
1
src/c-rbtree/meson_options.txt
Normal file
@@ -0,0 +1 @@
|
||||
option('ptrace', type: 'boolean', value: false, description: 'Allow ptrace in test suite')
|
@@ -144,6 +144,11 @@ static inline void c_rbnode_init(CRBNode *n) {
|
||||
*
|
||||
* Return: Pointer to parent container, or NULL.
|
||||
*/
|
||||
/*
|
||||
* Note: This was carefully designed to avoid multiple evaluation of `_what`,
|
||||
* but avoid context-expression-extensions. That is why it uses the
|
||||
* possibly odd style of `(x ?: offsetof(...)) - offsetof(...))`.
|
||||
*/
|
||||
#define c_rbnode_entry(_what, _t, _m) \
|
||||
((_t *)(void *)(((unsigned long)(void *)(_what) ?: \
|
||||
offsetof(_t, _m)) - offsetof(_t, _m)))
|
||||
|
@@ -8,8 +8,8 @@ libcrbtree_deps = [
|
||||
dep_cstdaux,
|
||||
]
|
||||
|
||||
libcrbtree_private = static_library(
|
||||
'crbtree-private',
|
||||
libcrbtree_both = both_libraries(
|
||||
'crbtree-'+major,
|
||||
[
|
||||
'c-rbtree.c',
|
||||
],
|
||||
@@ -18,26 +18,19 @@ libcrbtree_private = static_library(
|
||||
'-fno-common',
|
||||
],
|
||||
dependencies: libcrbtree_deps,
|
||||
pic: true,
|
||||
)
|
||||
|
||||
libcrbtree_shared = shared_library(
|
||||
'crbtree',
|
||||
objects: libcrbtree_private.extract_all_objects(),
|
||||
dependencies: libcrbtree_deps,
|
||||
install: not meson.is_subproject(),
|
||||
soversion: 0,
|
||||
link_depends: libcrbtree_symfile,
|
||||
link_args: [
|
||||
'-Wl,--no-undefined',
|
||||
'-Wl,--version-script=@0@'.format(libcrbtree_symfile),
|
||||
],
|
||||
link_depends: libcrbtree_symfile,
|
||||
soversion: 0,
|
||||
)
|
||||
|
||||
libcrbtree_dep = declare_dependency(
|
||||
include_directories: include_directories('.'),
|
||||
link_with: libcrbtree_private,
|
||||
dependencies: libcrbtree_deps,
|
||||
include_directories: include_directories('.'),
|
||||
link_with: libcrbtree_both.get_static_lib(),
|
||||
version: meson.project_version(),
|
||||
)
|
||||
|
||||
@@ -45,11 +38,11 @@ if not meson.is_subproject()
|
||||
install_headers('c-rbtree.h')
|
||||
|
||||
mod_pkgconfig.generate(
|
||||
libraries: libcrbtree_shared,
|
||||
version: meson.project_version(),
|
||||
name: 'libcrbtree',
|
||||
filebase: 'libcrbtree',
|
||||
description: project_description,
|
||||
filebase: 'libcrbtree-'+major,
|
||||
libraries: libcrbtree_both.get_shared_lib(),
|
||||
name: 'libcrbtree',
|
||||
version: meson.project_version(),
|
||||
)
|
||||
endif
|
||||
|
||||
@@ -57,7 +50,7 @@ endif
|
||||
# target: test-*
|
||||
#
|
||||
|
||||
test_api = executable('test-api', ['test-api.c'], link_with: libcrbtree_shared)
|
||||
test_api = executable('test-api', ['test-api.c'], link_with: libcrbtree_both.get_shared_lib())
|
||||
test('API Symbol Visibility', test_api)
|
||||
|
||||
test_basic = executable('test-basic', ['test-basic.c'], dependencies: libcrbtree_dep)
|
||||
@@ -70,7 +63,9 @@ test_misc = executable('test-misc', ['test-misc.c'], dependencies: libcrbtree_de
|
||||
test('Miscellaneous', test_misc)
|
||||
|
||||
test_parallel = executable('test-parallel', ['test-parallel.c'], dependencies: libcrbtree_dep)
|
||||
test('Lockless Parallel Readers', test_parallel)
|
||||
if use_ptrace
|
||||
test('Lockless Parallel Readers', test_parallel)
|
||||
endif
|
||||
|
||||
test_posix = executable('test-posix', ['test-posix.c'], dependencies: libcrbtree_dep)
|
||||
test('Posix tsearch(3p) Comparison', test_posix)
|
||||
|
@@ -364,9 +364,6 @@ int main(int argc, char **argv) {
|
||||
unsigned int i;
|
||||
int r;
|
||||
|
||||
if (!getenv("CRBTREE_TEST_PTRACE"))
|
||||
return 77;
|
||||
|
||||
/* we want stable tests, so use fixed seed */
|
||||
srand(0xdeadbeef);
|
||||
|
||||
|
Submodule src/c-rbtree/subprojects/c-stdaux deleted from c5f166d02f
3
src/c-rbtree/subprojects/libcstdaux-1.wrap
Normal file
3
src/c-rbtree/subprojects/libcstdaux-1.wrap
Normal file
@@ -0,0 +1,3 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/c-util/c-stdaux.git
|
||||
revision = v1
|
Reference in New Issue
Block a user