mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-12 10:21:26 -04:00
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>
This commit is contained in:
parent
2ff54d66a2
commit
eabb8eed0b
4 changed files with 8 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
2
perf.c
2
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
|
||||
|
|
|
|||
2
pkcs11.c
2
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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue