瀏覽代碼

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 7 年之前
父節點
當前提交
3de1610064
共有 1 個文件被更改,包括 3 次插入0 次删除
  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)
 mg_strndup_ctx(const char *ptr, size_t len, struct mg_context *ctx)
 {
 {
 	char *p;
 	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) {
 	if ((p = (char *)mg_malloc_ctx(len + 1, ctx)) != NULL) {
 		mg_strlcpy(p, ptr, len + 1);
 		mg_strlcpy(p, ptr, len + 1);