Explorar o código

Avoid spurious Visual Studio warning

if USE_SERVER_STATS is not defined, Visual studio considers ctx as unused
although it is used in mg_malloc_ctx
bel2125 %!s(int64=7) %!d(string=hai) anos
pai
achega
3de1610064
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/civetweb.c

+ 3 - 0
src/civetweb.c

@@ -3096,6 +3096,9 @@ static char *
 mg_strndup_ctx(const char *ptr, size_t len, struct mg_context *ctx)
 {
 	char *p;
+	(
+	    void)ctx; /* Avoid Visual Studio warning if USE_SERVER_STATS is not
+                   * defined */
 
 	if ((p = (char *)mg_malloc_ctx(len + 1, ctx)) != NULL) {
 		mg_strlcpy(p, ptr, len + 1);