From 6d2dc91f1fcf5155d7c3db443e68d6a0ef23a8e7 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Wed, 20 Jul 2016 16:22:13 +0800 Subject: [PATCH] fixed build issue --- .travis.yml | 2 +- test.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index add12ec..73f3c9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,5 @@ compiler: - gcc - clang script: - - gcc -O3 test.cpp -o test + - $CC -O3 test.cpp -o test diff --git a/test.cpp b/test.cpp index 519dfec..feec63d 100644 --- a/test.cpp +++ b/test.cpp @@ -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; }