Browse code

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>

David Sommerseth authored on 2010/11/15 16:48:57
Showing 4 changed files
... ...
@@ -470,5 +470,7 @@ int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop)
470 470
 }
471 471
 
472 472
 #else
473
+#ifdef _MSC_VER  /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
473 474
 static void dummy (void) {}
475
+#endif
474 476
 #endif				/* WIN32 */
... ...
@@ -139,7 +139,8 @@ LPCTSTR getIeHttpProxy()
139 139
     return(NULL);
140 140
   }
141 141
 }
142
-
143 142
 #else
143
+#ifdef _MSC_VER  /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
144 144
 static void dummy (void) {}
145
+#endif
145 146
 #endif				/* WIN32 */
... ...
@@ -287,5 +287,7 @@ perf_print_state (int lev)
287 287
 }
288 288
 
289 289
 #else
290
+#ifdef _MSC_VER  /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
290 291
 static void dummy(void) {}
291 292
 #endif
293
+#endif
... ...
@@ -982,5 +982,7 @@ cleanup:
982 982
 }
983 983
 
984 984
 #else
985
+#ifdef _MSC_VER  /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
985 986
 static void dummy (void) {}
987
+#endif
986 988
 #endif /* ENABLE_PKCS11 */