Revision: 7255 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7255 Author: zmatsuo Date: 2018-11-04 00:32:41 +0900 (Sun, 04 Nov 2018) Log Message: ----------- TTXttyrecをコンパイルできるようにした - gettimeofday()の警告対策 Modified Paths: -------------- branches/cmake/TTXSamples/CMakeLists.txt branches/cmake/TTXSamples/TTXttyrec/CMakeLists.txt branches/cmake/TTXSamples/TTXttyrec/TTXttyplay.c branches/cmake/TTXSamples/TTXttyrec/TTXttyrec.c branches/cmake/TTXSamples/TTXttyrec/gettimeofday.c branches/cmake/TTXSamples/TTXttyrec/gettimeofday.h -------------- next part -------------- Modified: branches/cmake/TTXSamples/CMakeLists.txt =================================================================== --- branches/cmake/TTXSamples/CMakeLists.txt 2018-09-21 17:37:44 UTC (rev 7254) +++ branches/cmake/TTXSamples/CMakeLists.txt 2018-11-03 15:32:41 UTC (rev 7255) @@ -38,11 +38,9 @@ add_subdirectory(TTXtest) set_target_properties(TTXtest PROPERTIES FOLDER TTXSamples) -if(MSVC) - add_subdirectory(TTXttyrec) - set_target_properties(TTXttyrec PROPERTIES FOLDER TTXSamples) - set_target_properties(TTXttyplay PROPERTIES FOLDER TTXSamples) -endif(MSVC) +add_subdirectory(TTXttyrec) +set_target_properties(TTXttyrec PROPERTIES FOLDER TTXSamples) +set_target_properties(TTXttyplay PROPERTIES FOLDER TTXSamples) add_subdirectory(TTXViewMode) set_target_properties(TTXViewMode PROPERTIES FOLDER TTXSamples) Modified: branches/cmake/TTXSamples/TTXttyrec/CMakeLists.txt =================================================================== --- branches/cmake/TTXSamples/TTXttyrec/CMakeLists.txt 2018-09-21 17:37:44 UTC (rev 7254) +++ branches/cmake/TTXSamples/TTXttyrec/CMakeLists.txt 2018-11-03 15:32:41 UTC (rev 7255) @@ -7,6 +7,12 @@ ../../teraterm/common ) +if(MINGW) + link_directories( + ${CMAKE_SOURCE_DIR}/teraterm/htmlhelp + ) +endif() + add_library( TTXttyplay SHARED TTXttyplay.c Modified: branches/cmake/TTXSamples/TTXttyrec/TTXttyplay.c =================================================================== --- branches/cmake/TTXSamples/TTXttyrec/TTXttyplay.c 2018-09-21 17:37:44 UTC (rev 7254) +++ branches/cmake/TTXSamples/TTXttyrec/TTXttyplay.c 2018-11-03 15:32:41 UTC (rev 7255) @@ -10,9 +10,9 @@ #include <winsock2.h> #include <ws2tcpip.h> -#if defined(_MSC_VER) +//#if defined(_MSC_VER) #include "gettimeofday.h" -#endif +//#endif #include "compat_w95.h" @@ -108,7 +108,7 @@ pvar->ChangeTitle = FALSE; pvar->ReplaceHostDlg = FALSE; pvar->played = FALSE; - gettimeofday(&(pvar->last), NULL); + gettimeofday(&(pvar->last) /*, NULL*/ ); pvar->wait.tv_sec = 0; pvar->wait.tv_usec = 1; pvar->pause = FALSE; @@ -133,11 +133,12 @@ static BOOL PASCAL TTXReadFile(HANDLE fh, LPVOID obuff, DWORD oblen, LPDWORD rbytes, LPOVERLAPPED rol) { static struct recheader prh = { 0, 0, 0 }; - static unsigned int lbytes; + static DWORD lbytes; static char ibuff[BUFFSIZE]; static BOOL title_changed = FALSE, first_title_changed = FALSE; - int b[3], rsize; + int b[3]; + DWORD rsize; struct recheader h; struct timeval curtime; struct timeval tdiff; @@ -191,7 +192,7 @@ } if (!pvar->nowait) { - gettimeofday(&curtime, NULL); + gettimeofday(&curtime /*, NULL*/ ); tdiff = tvdiff(pvar->last, curtime); } Modified: branches/cmake/TTXSamples/TTXttyrec/TTXttyrec.c =================================================================== --- branches/cmake/TTXSamples/TTXttyrec/TTXttyrec.c 2018-09-21 17:37:44 UTC (rev 7254) +++ branches/cmake/TTXSamples/TTXttyrec/TTXttyrec.c 2018-11-03 15:32:41 UTC (rev 7255) @@ -9,9 +9,7 @@ #include <winsock2.h> #include <ws2tcpip.h> -#if defined(_MSC_VER) #include "gettimeofday.h" -#endif #include "compat_w95.h" @@ -108,9 +106,10 @@ void WriteData(HANDLE fh, char *buff, int len) { struct timeval t; - int b[3], w; + int b[3]; + DWORD w; - gettimeofday(&t, NULL); + gettimeofday(&t /*, NULL*/ ); b[0] = t.tv_sec; b[1] = t.tv_usec; b[2] = len; Modified: branches/cmake/TTXSamples/TTXttyrec/gettimeofday.c =================================================================== --- branches/cmake/TTXSamples/TTXttyrec/gettimeofday.c 2018-09-21 17:37:44 UTC (rev 7254) +++ branches/cmake/TTXSamples/TTXttyrec/gettimeofday.c 2018-11-03 15:32:41 UTC (rev 7255) @@ -7,11 +7,9 @@ #define FTEPOCHDIFF 116444736000000000LL #endif -int gettimeofday(struct timeval *tv, struct timezone *tz) { +int gettimeofday(struct timeval *tv /*, struct timezone *tz*/ ) { FILETIME ft; __int64 t; - long tzsec; - int dst; if (tv) { GetSystemTimeAsFileTime(&ft); @@ -20,7 +18,10 @@ tv->tv_usec = (long)(t % 1000000); } +#if 0 if (tz) { + long tzsec; + int dst; if (_get_timezone(&tzsec) == 0 && _get_daylight(&dst) == 0) { tz->tz_minuteswest = tzsec / 60; tz->tz_dsttime = dst; @@ -29,6 +30,7 @@ return -1; } } +#endif return 0; } Modified: branches/cmake/TTXSamples/TTXttyrec/gettimeofday.h =================================================================== --- branches/cmake/TTXSamples/TTXttyrec/gettimeofday.h 2018-09-21 17:37:44 UTC (rev 7254) +++ branches/cmake/TTXSamples/TTXttyrec/gettimeofday.h 2018-11-03 15:32:41 UTC (rev 7255) @@ -10,7 +10,7 @@ }; #endif -int gettimeofday(struct timeval *tv, struct timezone *tz); +int gettimeofday(struct timeval *tv /*, struct timezone *tz*/ ); struct timeval tvdiff(struct timeval a, struct timeval b); struct timeval tvshift(struct timeval tv, int shift); int tvcmp(struct timeval a, struct timeval b);