1
0
mirror of https://github.com/skywind3000/kcp.git synced 2025-04-24 04:10:34 +08:00

fixed build issue

This commit is contained in:
skywind3000 2016-07-20 16:22:13 +08:00
parent 0df053a996
commit 6d2dc91f1f
2 changed files with 4 additions and 3 deletions

View File

@ -3,5 +3,5 @@ compiler:
- gcc
- clang
script:
- gcc -O3 test.cpp -o test
- $CC -O3 test.cpp -o test

View File

@ -20,8 +20,9 @@ LatencySimulator *vnet;
// 模拟网络:模拟发送一个 udp包
int udp_output(const char *buf, int len, ikcpcb *kcp, void *user)
{
int id = (int)user;
vnet->send(id, buf, len);
union { int id; void *ptr; } parameter;
parameter.ptr = user;
vnet->send(parameter.id, buf, len);
return 0;
}