소스 검색

Disable Visual Studio warning (cast to different type, depending on OS)

bel 8 년 전
부모
커밋
39709cc37c
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/civetweb.c

+ 7 - 0
src/civetweb.c

@@ -12370,7 +12370,14 @@ close_socket_gracefully(struct mg_connection *conn)
 		/* Set linger option to avoid socket hanging out after close. This
 		 * prevent ephemeral port exhaust problem under high QPS. */
 		linger.l_onoff = 1;
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4244)
+#endif
 		linger.l_linger = (linger_timeout + 999) / 1000;
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 	} else {
 		linger.l_onoff = 0;
 		linger.l_linger = 0;