summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-11-15 08:48:57 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-11-18 18:54:49 +0100
commiteabb8eed0bc3b2b16722eeb38d8000eda35668a7 (patch)
tree0ba8f9cf032aadde50924015ec0ba6b896dd11de
parent2ff54d66a22402caf08709ec22730e20c193ecbd (diff)
downloadopenvpn-eabb8eed0bc3b2b16722eeb38d8000eda35668a7.tar.gz
openvpn-eabb8eed0bc3b2b16722eeb38d8000eda35668a7.tar.xz
openvpn-eabb8eed0bc3b2b16722eeb38d8000eda35668a7.zip
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 <dazo@users.sourceforge.net> Acked-by: Peter Stuge <peter@stuge.se>
-rw-r--r--cryptoapi.c2
-rw-r--r--ieproxy.c3
-rw-r--r--perf.c2
-rw-r--r--pkcs11.c2
4 files changed, 8 insertions, 1 deletions
diff --git a/cryptoapi.c b/cryptoapi.c
index 8fb5387..3365cd7 100644
--- a/cryptoapi.c
+++ b/cryptoapi.c
@@ -470,5 +470,7 @@ int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop)
}
#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void dummy (void) {}
+#endif
#endif /* WIN32 */
diff --git a/ieproxy.c b/ieproxy.c
index 89977a8..3099870 100644
--- a/ieproxy.c
+++ b/ieproxy.c
@@ -139,7 +139,8 @@ LPCTSTR getIeHttpProxy()
return(NULL);
}
}
-
#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void dummy (void) {}
+#endif
#endif /* WIN32 */
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
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 */