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>
}
#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void dummy (void) {}
+#endif
#endif /* WIN32 */
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 */
}
#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void dummy(void) {}
#endif
+#endif
}
#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void dummy (void) {}
+#endif
#endif /* ENABLE_PKCS11 */