switched to meson build system, added from/to_cstring(), refactored/simplified some string functions, refactored some vector functions, added tests
13 files changed, 28 insertions(+), 22 deletions(-)
|
| 1 | + | #build directories |
| 2 | + | build/ |
| 3 | + | |
| 4 | + | |
| 1 | 5 | | # Prerequisites |
| 2 | 6 | | *.d |
| 3 | 7 | | |
| 4 | | - | #binaries |
| 5 | | - | test |
| 6 | | - | |
| 7 | 8 | | # Object files |
| 8 | 9 | | *.o |
| 9 | 10 | | *.ko |
|
| 52 | 53 | | modules.order |
| 53 | 54 | | Module.symvers |
| 54 | 55 | | Mkfile.old |
| 55 | | - | dkms.conf |
| 56 | + | dkms.conf |
|
| 1 | | - | all: |
| 2 | | - | gcc -Og -g -march=native -shared -fPIC -fstrict-aliasing vector.c dyn_string.c -o libcutils.so -flto \ |
| 3 | | - | -Wall -Wpedantic -Wnull-dereference -Wshadow -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wstrict-overflow=5 -Wunreachable-code -Wno-unused-parameter \ |
| 4 | | - | -fsanitize=undefined |
| 5 | | - | |
| 6 | | - | test: |
| 7 | | - | gcc -Og -g -march=native -fPIC -fstrict-aliasing vector.c dyn_string.c test.c -o test -flto \ |
| 8 | | - | -Wall -Wpedantic -Wnull-dereference -Wshadow -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wstrict-overflow=5 -Wunreachable-code -Wno-unused-parameter \ |
| 9 | | - | -fsanitize=undefined |
|
| 1 | | - | #ifndef CUTILS_H |
| 2 | | - | #define CUTILS_H |
| 3 | | - | #include "vector.h" |
| 4 | | - | #include "dyn_string.h" |
| 5 | | - | #include "cutils_endian.h" |
| 6 | | - | #endif //CUTILS_H |
|
| 1 | + | #ifndef CUTILS_H |
| 2 | + | #define CUTILS_H |
| 3 | + | #include <cutils/vector.h> |
| 4 | + | #include <cutils/dyn_string.h> |
| 5 | + | #include <cutils/cutils_endian.h> |
| 6 | + | #endif //CUTILS_H |
No textual changes.
No textual changes.
No textual changes.
|
| 1 | + | inc = include_directories('.') |
|
| 1 | + | project('cutils', 'c') |
| 2 | + | |
| 3 | + | CFLAGS = ['-std=c11', '-fstrict-aliasing', '-Wall', '-Wpedantic', '-Wextra'] |
| 4 | + | |
| 5 | + | subdir('include') |
| 6 | + | subdir('src') |
|
| 1 | | - | #include "dyn_string.h" |
| 1 | + | #include <cutils/dyn_string.h> |
| 2 | 2 | | |
| 3 | 3 | | String* new_string(void) |
| 4 | 4 | | { |
|
| 1 | + | src = ['vector.c', 'dyn_string.c'] |
| 2 | + | srctest = src + ['test.c'] |
| 3 | + | |
| 4 | + | lib = shared_library('cutils', src, include_directories : inc) |
| 5 | + | cutils_dep = declare_dependency(link_with : lib) |
| 6 | + | |
| 7 | + | executable('test_cutils', srctest, include_directories : inc, c_args: CFLAGS ) |
|
| 1 | | - | #include "cutils.h" |
| 1 | + | #include <cutils/cutils.h> |
| 2 | 2 | | #include <stdio.h> |
| 3 | 3 | | |
| 4 | 4 | | struct test |
|
| 1 | | - | #include "vector.h" |
| 1 | + | #include <cutils/vector.h> |
| 2 | 2 | | |
| 3 | 3 | | Vector* new_vector(void) |
| 4 | 4 | | { |