summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-30 21:19:30 +0800
committerruki <[email protected]>2018-09-30 21:19:30 +0800
commit661909c4299c0b4eb511921269a2948c0aa9ad7c (patch)
tree8f4b6bcdb5b873bcac93e41b7f41107ac364ec38 /core/src
parent7db59cdf2dddfebbf71346bb75fe0665653493fa (diff)
fix compile errors
Diffstat (limited to 'core/src')
-rw-r--r--core/src/tbox/src/tbox/platform/windows/interface/ws2_32.c10
-rw-r--r--core/src/tbox/src/tbox/platform/windows/interface/ws2_32.h8
2 files changed, 15 insertions, 3 deletions
diff --git a/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.c b/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.c
index d75f6b7aa..c262e3adb 100644
--- a/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.c
+++ b/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.c
@@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- * Copyright (C) 2009 - 2017, TBOOX Open Source Group.
+ * Copyright (C) 2009 - 2018, TBOOX Open Source Group.
*
* @author ruki
* @file ws2_32.c
@@ -30,6 +30,11 @@
#include "../../../utils/utils.h"
/* //////////////////////////////////////////////////////////////////////////////////////
+ * pragma
+ */
+#pragma comment(lib, "Ws2_32.lib")
+
+/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
static tb_bool_t tb_ws2_32_instance_init(tb_handle_t instance, tb_cpointer_t priv)
@@ -40,7 +45,7 @@ static tb_bool_t tb_ws2_32_instance_init(tb_handle_t instance, tb_cpointer_t pri
// the ws2_32 module
HANDLE module = GetModuleHandleA("ws2_32.dll");
- if (!module) module = tb_dynamic_init("ws2_32.dll");
+ if (!module) module = (HANDLE)tb_dynamic_init("ws2_32.dll");
tb_assert_and_check_return_val(module, tb_false);
// init interfaces
@@ -49,6 +54,7 @@ static tb_bool_t tb_ws2_32_instance_init(tb_handle_t instance, tb_cpointer_t pri
TB_INTERFACE_LOAD(ws2_32, WSASocketA);
TB_INTERFACE_LOAD(ws2_32, WSAIoctl);
TB_INTERFACE_LOAD(ws2_32, WSAGetLastError);
+ TB_INTERFACE_LOAD(ws2_32, WSAEnumProtocolsW);
TB_INTERFACE_LOAD(ws2_32, WSASend);
TB_INTERFACE_LOAD(ws2_32, WSARecv);
TB_INTERFACE_LOAD(ws2_32, WSASendTo);
diff --git a/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.h b/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.h
index 946e289ed..7a2abfae5 100644
--- a/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.h
+++ b/core/src/tbox/src/tbox/platform/windows/interface/ws2_32.h
@@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- * Copyright (C) 2009 - 2017, TBOOX Open Source Group.
+ * Copyright (C) 2009 - 2018, TBOOX Open Source Group.
*
* @author ruki
* @file ws2_32.h
@@ -51,6 +51,9 @@ typedef SOCKET (WSAAPI* tb_ws2_32_WSASocketA_t)(tb_int_t af, tb_int_t type, tb_i
// the WSAGetLastError func type
typedef tb_int_t (WSAAPI* tb_ws2_32_WSAGetLastError_t)(tb_void_t);
+// the WSAEnumProtocolsW func type
+typedef tb_int_t (WSAAPI* tb_ws2_32_WSAEnumProtocolsW_t)(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer, LPDWORD lpdwBufferLength);
+
// the WSAIoctl func type
typedef tb_int_t (WSAAPI* tb_ws2_32_WSAIoctl_t)(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
@@ -150,6 +153,9 @@ typedef struct __tb_ws2_32_t
// WSAGetLastError
tb_ws2_32_WSAGetLastError_t WSAGetLastError;
+ // WSAEnumProtocolsW
+ tb_ws2_32_WSAEnumProtocolsW_t WSAEnumProtocolsW;
+
// WSASend
tb_ws2_32_WSASend_t WSASend;