From 36f55b7e22f2c5a2e9d68be6c0d86d99425cfe1e Mon Sep 17 00:00:00 2001 From: wangyu Date: Sun, 3 Jun 2018 20:43:57 -0700 Subject: [PATCH 1/2] fix itimerspec --- common.h | 2 +- fec_manager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.h b/common.h index 6fdc955..4aa5521 100644 --- a/common.h +++ b/common.h @@ -58,7 +58,7 @@ typedef int i32_t; typedef unsigned short u16_t; typedef short i16_t; -struct itimerspec { +struct my_itimerspec { struct timespec it_interval; /* Timer interval */ struct timespec it_value; /* Initial expiration */ }; diff --git a/fec_manager.cpp b/fec_manager.cpp index fcb6a2a..73d73fa 100644 --- a/fec_manager.cpp +++ b/fec_manager.cpp @@ -176,7 +176,7 @@ int fec_encode_manager_t::append(char *s,int len/*,int &is_first_packet*/) { if(counter==0) { - itimerspec its; + my_itimerspec its; memset(&its.it_interval,0,sizeof(its.it_interval)); first_packet_time=get_current_time_us(); my_time_t tmp_time=fec_timeout+first_packet_time; @@ -413,7 +413,7 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/) output_n=actual_data_num+actual_redundant_num; blob_encode.clear(); - itimerspec its; + my_itimerspec its; memset(&its,0,sizeof(its)); ev_timer_stop(loop, &timer); //timerfd_settime(timer_fd,TFD_TIMER_ABSTIME,&its,0); From 2051e47399f2f31e9cbc08928952748e5e673c56 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-T772REH\\wangyu" Date: Mon, 4 Jun 2018 11:52:33 +0800 Subject: [PATCH 2/2] port to cygwin --- common.h | 2 +- log.h | 2 +- makefile | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common.h b/common.h index 4aa5521..2a9d7ff 100644 --- a/common.h +++ b/common.h @@ -26,7 +26,7 @@ #include //Provides declarations for tcp header #include #include //Provides declarations for ip header -#include +//#include #include #include #include diff --git a/log.h b/log.h index b97acd0..37e290d 100755 --- a/log.h +++ b/log.h @@ -28,7 +28,7 @@ #include //Provides declarations for tcp header #include #include //Provides declarations for ip header -#include +//#include #include #include #include diff --git a/makefile b/makefile index 1dcf610..5b2674e 100755 --- a/makefile +++ b/makefile @@ -17,7 +17,11 @@ TAR=${NAME}_binaries.tar.gz `echo ${TARGETS}|sed -r 's/([^ ]+)/speederv2_\1/g'` all:git_version rm -f ${NAME} - ${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -ggdb -static -O3 + ${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -ggdb -static -O3 + +cygwin:git_version + rm -f ${NAME} + ${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -ggdb -static -O3 -D_GNU_SOURCE mac:git_version rm -f ${NAME}