This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch feature/celix_err
in repository https://gitbox.apache.org/repos/asf/celix.git

commit d1ce85a464fed913006e228224fe9c7e0e7cdebe
Author: Pepijn Noltes <[email protected]>
AuthorDate: Tue May 2 17:03:16 2023 +0200

    Add celix tss to the threads_ei lib
---
 libs/error_injector/celix_threads/CMakeLists.txt   |  9 ++++++-
 .../celix_threads/include/celix_threads_ei.h       |  6 +++++
 .../celix_threads/src/celix_threads_ei.cc          | 30 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/libs/error_injector/celix_threads/CMakeLists.txt 
b/libs/error_injector/celix_threads/CMakeLists.txt
index 9cd6fa47..9cc5b83d 100644
--- a/libs/error_injector/celix_threads/CMakeLists.txt
+++ b/libs/error_injector/celix_threads/CMakeLists.txt
@@ -20,5 +20,12 @@ add_library(threads_ei STATIC src/celix_threads_ei.cc)
 target_include_directories(threads_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
 target_link_libraries(threads_ei PUBLIC Celix::error_injector Celix::utils)
 
-target_link_options(threads_ei INTERFACE LINKER:--wrap,celixThreadMutex_create 
LINKER:--wrap,celixThread_create)
+target_link_options(threads_ei INTERFACE
+        LINKER:--wrap,celixThreadMutex_create
+        LINKER:--wrap,celixThread_create
+        LINKER:--wrap,celix_tss_create
+        LINKER:--wrap,celix_tss_delete
+        LINKER:--wrap,celix_tss_set
+        LINKER:--wrap,celix_tss_get
+)
 add_library(Celix::threads_ei ALIAS threads_ei)
diff --git a/libs/error_injector/celix_threads/include/celix_threads_ei.h 
b/libs/error_injector/celix_threads/include/celix_threads_ei.h
index 44360e9b..48a2e35c 100644
--- a/libs/error_injector/celix_threads/include/celix_threads_ei.h
+++ b/libs/error_injector/celix_threads/include/celix_threads_ei.h
@@ -29,6 +29,12 @@ extern "C" {
 
 CELIX_EI_DECLARE(celixThreadMutex_create, celix_status_t);
 CELIX_EI_DECLARE(celixThread_create, celix_status_t);
+
+CELIX_EI_DECLARE(celix_tss_create, celix_status_t);
+CELIX_EI_DECLARE(celix_tss_delete, celix_status_t);
+CELIX_EI_DECLARE(celix_tss_set, celix_status_t);
+CELIX_EI_DECLARE(celix_tss_get, void*);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/libs/error_injector/celix_threads/src/celix_threads_ei.cc 
b/libs/error_injector/celix_threads/src/celix_threads_ei.cc
index ab55cd88..3a09b276 100644
--- a/libs/error_injector/celix_threads/src/celix_threads_ei.cc
+++ b/libs/error_injector/celix_threads/src/celix_threads_ei.cc
@@ -23,6 +23,7 @@
 #include "celix_errno.h"
 
 extern "C" {
+
 celix_status_t __real_celixThreadMutex_create(celix_thread_mutex_t *__mutex, 
celix_thread_mutexattr_t *__attr);
 CELIX_EI_DEFINE(celixThreadMutex_create, celix_status_t)
 celix_status_t __wrap_celixThreadMutex_create(celix_thread_mutex_t *__mutex, 
celix_thread_mutexattr_t *__attr) {
@@ -36,4 +37,33 @@ celix_status_t __wrap_celixThread_create(celix_thread_t 
*__new_thread, celix_thr
     CELIX_EI_IMPL(celixThread_create);
     return __real_celixThread_create(__new_thread, __attr, __func, __data);
 }
+
+celix_status_t __real_celix_tss_create(celix_tss_key_t* __key, void 
(*__destroyFunction)(void*));
+CELIX_EI_DEFINE(celix_tss_create, celix_status_t)
+celix_status_t __wrap_celix_tss_create(celix_tss_key_t* __key, void 
(*__destroyFunction)(void*)) {
+    CELIX_EI_IMPL(celix_tss_create);
+    return __real_celix_tss_create(__key, __destroyFunction);
+}
+
+celix_status_t __real_celix_tss_delete(celix_tss_key_t __key);
+CELIX_EI_DEFINE(celix_tss_delete, celix_status_t)
+celix_status_t __wrap_celix_tss_delete(celix_tss_key_t __key) {
+    CELIX_EI_IMPL(celix_tss_delete);
+    return __real_celix_tss_delete(__key);
+}
+
+celix_status_t __real_celix_tss_set(celix_tss_key_t __key, void* __value);
+CELIX_EI_DEFINE(celix_tss_set, celix_status_t)
+celix_status_t __wrap_celix_tss_set(celix_tss_key_t __key, void* __value) {
+    CELIX_EI_IMPL(celix_tss_set);
+    return __real_celix_tss_set(__key, __value);
+}
+
+void* __real_celix_tss_get(celix_tss_key_t __key);
+CELIX_EI_DEFINE(celix_tss_get, void*)
+void* __wrap_celix_tss_get(celix_tss_key_t __key) {
+    CELIX_EI_IMPL(celix_tss_get);
+    return __real_celix_tss_get(__key);
+}
+
 }

Reply via email to