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 --- pkcs11.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkcs11.c') diff --git a/pkcs11.c b/pkcs11.c index e06a2ed..d90ac96 100644 --- a/pkcs11.c +++ b/pkcs11.c @@ -982,5 +982,7 @@ cleanup: } #else +#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */ static void dummy (void) {} +#endif #endif /* ENABLE_PKCS11 */ -- cgit v1.2.3