X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2Fthreads%2Ftss_get.c;h=a5e5efbd4bf81817033a6a3b327925beeadae5b3;hp=acb7c62e68b74becf0a925648fda881caa14d0ca;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/platform/win32/functions/threads/tss_get.c b/platform/win32/functions/threads/tss_get.c index acb7c62..a5e5efb 100644 --- a/platform/win32/functions/threads/tss_get.c +++ b/platform/win32/functions/threads/tss_get.c @@ -1,33 +1,33 @@ -#ifndef REGTEST -#include -#include - -void *tss_get(tss_t key) -{ - return TlsGetValue(key->_Key); -} -#endif - -#ifdef TEST -#include "_PDCLIB_test.h" - -#ifndef REGTEST -static tss_t key; -static char v; -#endif - -// Todo: make a thread and test destruction! - -int main( void ) -{ -#ifndef REGTEST - TESTCASE(tss_create(&key, NULL) == thrd_success); - TESTCASE(tss_get(key) == NULL); - TESTCASE(tss_set(key, &v) == thrd_success); - TESTCASE(tss_get(key) == &v); - tss_delete(key); -#endif - return TEST_RESULTS; -} - +#ifndef REGTEST +#include +#include + +void *tss_get(tss_t key) +{ + return TlsGetValue(key->_Key); +} +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +#ifndef REGTEST +static tss_t key; +static char v; +#endif + +// Todo: make a thread and test destruction! + +int main( void ) +{ +#ifndef REGTEST + TESTCASE(tss_create(&key, NULL) == thrd_success); + TESTCASE(tss_get(key) == NULL); + TESTCASE(tss_set(key, &v) == thrd_success); + TESTCASE(tss_get(key) == &v); + tss_delete(key); +#endif + return TEST_RESULTS; +} + #endif \ No newline at end of file