Browse Source

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

bel 8 năm trước cách đây
mục cha
commit
39709cc37c
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  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;