From d640379bb205194cb3c7876af91e0816e119aacd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 17 Sep 2014 20:55:15 +0200 Subject: add setter and getter wrapper for thread local variables so wrappers not understanding __thread can use them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/lib/libgamma-error.c.gpp | 16 ++++++++++++++++ src/lib/libgamma-error.h | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/lib/libgamma-error.c.gpp b/src/lib/libgamma-error.c.gpp index 1cc81ac..1ed67b6 100644 --- a/src/lib/libgamma-error.c.gpp +++ b/src/lib/libgamma-error.c.gpp @@ -39,6 +39,14 @@ $>export PATH=".:${PATH}" */ #ifndef __WIN32__ __thread gid_t libgamma_group_gid = 0; +gid_t get_libgamma_group_gid(void) +{ + return libgamma_group_gid; +} +void set_libgamma_group_gid(gid_t value) +{ + libgamma_group_gid = value; +} #else short libgamma_group_gid = 0; #endif @@ -51,6 +59,14 @@ short libgamma_group_gid = 0; */ #ifndef __WIN32__ __thread const char* libgamma_group_name = NULL; +const char* get_libgamma_group_name(void) +{ + return libgamma_group_name; +} +void set_libgamma_group_name(const char* value) +{ + libgamma_group_name = value; +} #else const char* libgamma_group_name = NULL; #endif diff --git a/src/lib/libgamma-error.h b/src/lib/libgamma-error.h index 73c224a..0b6831c 100644 --- a/src/lib/libgamma-error.h +++ b/src/lib/libgamma-error.h @@ -36,6 +36,8 @@ */ #ifndef __WIN32__ extern __thread gid_t libgamma_group_gid; +gid_t get_libgamma_group_gid(void) __attribute__((pure)); +void set_libgamma_group_gid(gid_t value); #else extern short libgamma_group_gid; #endif @@ -48,6 +50,8 @@ extern short libgamma_group_gid; */ #ifndef __WIN32__ extern __thread const char* libgamma_group_name; +const char* get_libgamma_group_name(void) __attribute__((pure)); +void set_libgamma_group_name(const char* value); #else extern const char* libgamma_group_name; #endif -- cgit v1.2.3-70-g09d2