From 7aa6c12a4424d00ea0add0a849f8a5b31a2de6a1 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Sat, 28 Aug 2010 20:14:36 +0200 Subject: Clean-up: Remove pthread and mutex locking code This code was not activated at all, and hard coded as disabled in syshead.h with this code snippet: /* * Pthread support is currently experimental (and quite unfinished). */ #if 1 /* JYFIXME -- if defined, disable pthread */ #undef USE_PTHREAD #endif So no matter if --enable-pthread when running ./configure or not, this feature was never enabled in reality. Further, by removing the blocker code above made OpenVPN uncompilable in the current state. As the threading part needs to be completely rewritten and pthreading will not be supported in OpenVPN 2.x, removing this code seems most reasonable. In addition, a lot of mutex locking code was also removed, as they were practically NOP functions, due to pthreading being forcefully disabled Signed-off-by: David Sommerseth Acked-by: James Yonan --- perf.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'perf.c') diff --git a/perf.c b/perf.c index 9af680f..a149c07 100644 --- a/perf.c +++ b/perf.c @@ -33,10 +33,6 @@ #include "memdbg.h" -#ifdef USE_PTHREAD -#error ENABLE_PERFORMANCE_METRICS is incompatible with USE_PTHREAD -#endif - static const char *metric_names[] = { "PERF_BIO_READ_PLAINTEXT", "PERF_BIO_WRITE_PLAINTEXT", -- cgit v1.2.3 From eabb8eed0bc3b2b16722eeb38d8000eda35668a7 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 15 Nov 2010 08:48:57 +0100 Subject: Fix compiler warnings about not used dummy() functions It has been reported that the Microsoft Visual C compiler complains if a .c file do not contain any compilable code, which can happen if the code has been #ifdef'ed out. To avoid this, these #ifdef sections have a #else section which adds a static dummy() function which does nothing. On the other hand, the GNU C compiler complains about unused functions when it discovers this situation. This patch tries to only add these dummy() functions if the Microsoft Visual C compiler is detected, via the _MSC_VER macro. Signed-off-by: David Sommerseth Acked-by: Peter Stuge --- perf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'perf.c') diff --git a/perf.c b/perf.c index a149c07..67ea958 100644 --- a/perf.c +++ b/perf.c @@ -287,5 +287,7 @@ perf_print_state (int lev) } #else +#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */ static void dummy(void) {} #endif +#endif -- cgit v1.2.3