瀏覽代碼

move _WINSOCK_DEPRECATED_NO_WARNINGS into plugin flags.make

so we get no warnings we people drop in the single-file release
Julius Pfrommer 8 年之前
父節點
當前提交
26ca69f38c
共有 2 個文件被更改,包括 1 次插入1 次删除
  1. 0 1
      CMakeLists.txt
  2. 1 0
      plugins/ua_network_tcp.c

+ 0 - 1
CMakeLists.txt

@@ -94,7 +94,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")
 elseif(MSVC)
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX") # Compiler warnings, error on warning
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_WARNINGS") # don't give warnings for scanf and printf
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_WINSOCK_DEPRECATED_NO_WARNINGS") # inet_ntoa is deprecated but used for compatibility
   set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
 endif()

+ 1 - 0
plugins/ua_network_tcp.c

@@ -19,6 +19,7 @@
 #include <errno.h>
 #ifdef _WIN32
 # include <malloc.h>
+# define _WINSOCK_DEPRECATED_NO_WARNINGS /* inet_ntoa is deprecated on MSVC but used for compatibility */
 # include <ws2tcpip.h>
 # define CLOSESOCKET(S) closesocket((SOCKET)S)
 # define ssize_t int