[Ttssh2-commit] [7536] MinGWでビルドできるよう調整

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 4月 1日 (月) 21:45:03 JST


Revision: 7536
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7536
Author:   zmatsuo
Date:     2019-04-01 21:45:02 +0900 (Mon, 01 Apr 2019)
Log Message:
-----------
MinGWでビルドできるよう調整

Modified Paths:
--------------
    trunk/CMakeLists.txt
    trunk/TTProxy/ProxyWSockHook.h
    trunk/TTProxy/TTProxy.cpp
    trunk/TTProxy/TTProxy.h
    trunk/TTProxy/YCL/include/YCL/Array.h
    trunk/TTProxy/YCL/include/YCL/HASHCODE.h
    trunk/TTProxy/YCL/include/YCL/Hashtable.h
    trunk/TTXKanjiMenu/CMakeLists.txt
    trunk/TTXSamples/TTXAdditionalTitle/CMakeLists.txt
    trunk/TTXSamples/TTXAlwaysOnTop/CMakeLists.txt
    trunk/TTXSamples/TTXCallSysMenu/CMakeLists.txt
    trunk/TTXSamples/TTXCommandLineOpt/CMakeLists.txt
    trunk/TTXSamples/TTXCopyIniFile/CMakeLists.txt
    trunk/TTXSamples/TTXFixedWinSize/CMakeLists.txt
    trunk/TTXSamples/TTXKcodeChange/CMakeLists.txt
    trunk/TTXSamples/TTXOutputBuffering/CMakeLists.txt
    trunk/TTXSamples/TTXRecurringCommand/CMakeLists.txt
    trunk/TTXSamples/TTXResizeMenu/CMakeLists.txt
    trunk/TTXSamples/TTXResizeWin/CMakeLists.txt
    trunk/TTXSamples/TTXShowCommandLine/CMakeLists.txt
    trunk/TTXSamples/TTXViewMode/CMakeLists.txt
    trunk/TTXSamples/TTXttyrec/TTXttyplay.c
    trunk/TTXSamples/TTXttyrec/TTXttyrec.c
    trunk/TTXSamples/TTXttyrec/gettimeofday.c
    trunk/TTXSamples/TTXttyrec/gettimeofday.h
    trunk/TTXSamples/ttxtest/CMakeLists.txt
    trunk/teraterm/CMakeLists.txt
    trunk/teraterm/common/i18n.c
    trunk/teraterm/common/i18n.h
    trunk/teraterm/common/servicenames.h
    trunk/teraterm/common/ttcommon.h
    trunk/teraterm/common/ttftypes.h
    trunk/teraterm/common/ttlib.h
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/ttplug.c
    trunk/teraterm/teraterm/vtdisp.c
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/winjump.c
    trunk/teraterm/ttpcmn/CMakeLists.txt
    trunk/teraterm/ttpcmn/language.c
    trunk/teraterm/ttpcmn/language.h
    trunk/teraterm/ttpcmn/ttcmn.c
    trunk/ttssh2/ttxssh/CMakeLists.txt
    trunk/ttssh2/ttxssh/buffer.c
    trunk/ttssh2/ttxssh/fwd-socks.c
    trunk/ttssh2/ttxssh/fwd.c
    trunk/ttssh2/ttxssh/key.c
    trunk/ttssh2/ttxssh/key.h
    trunk/ttssh2/ttxssh/keyfiles.c
    trunk/ttssh2/ttxssh/ssh.c

Removed Paths:
-------------
    trunk/teraterm/svnrev/CMakeLists.txt

-------------- next part --------------
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -38,10 +38,8 @@
 elseif(MINGW)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra "
-    "-Wno-unused-parameter -static -ffunction-sections -fdata-sections ${C_ONLY_FLAGS}")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra "
-    "-Wno-unused-parameter -static -ffunction-sections -fdata-sections")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections ${C_ONLY_FLAGS}")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections")
   if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
@@ -96,8 +94,13 @@
 ####
 # ソースツリー内に生成ファイルが存在していたら削除する
 if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/teraterm/ttpdlg/svnversion.h")
+  # r7517より前
   file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/teraterm/ttpdlg/svnversion.h")
 endif()
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/teraterm/teraterm/svnversion.h")
+  # r7517以後
+  file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/teraterm/teraterm/svnversion.h")
+endif()
 if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
   file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
 endif()

Modified: trunk/TTProxy/ProxyWSockHook.h
===================================================================
--- trunk/TTProxy/ProxyWSockHook.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTProxy/ProxyWSockHook.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -20,7 +20,7 @@
 
 extern char UILanguageFile[MAX_PATH];
 
-void UTIL_get_lang_msg(PCHAR key, PCHAR buf, int buf_len, PCHAR def)
+void UTIL_get_lang_msg(const char *key, PCHAR buf, int buf_len, const char *def)
 {
     GetI18nStr("TTProxy", key, buf, buf_len, def, UILanguageFile);
 }
@@ -44,7 +44,7 @@
 public:
     class MessageShower {
     public:
-        virtual void showMessage(const char* message)const = NULL;
+        virtual void showMessage(const char* message)const = 0;
     };
 private:
     struct DUMMYHOSTENT {

Modified: trunk/TTProxy/TTProxy.cpp
===================================================================
--- trunk/TTProxy/TTProxy.cpp	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTProxy/TTProxy.cpp	2019-04-01 12:45:02 UTC (rev 7536)
@@ -17,7 +17,8 @@
 	}
 }
 
-BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) {
+extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) {
+	(void)reserved;
 	switch (reason) {
 	case DLL_PROCESS_ATTACH:
 		myInstance = instance;
@@ -28,6 +29,9 @@
 		return TTProxy::getInstance().threadAttach();
 	case DLL_THREAD_DETACH:
 		return TTProxy::getInstance().threadDetach();
+	default:
+		TTXBind(0, NULL);	// dummy TODO \x96\xA2\x8Eg\x97p\x82ō폜\x82\xB3\x82\xEA\x82Ȃ\xA2\x82悤\x82ɂ\xB7\x82\xE9
+		break;
 	}
 	return FALSE;
 }

Modified: trunk/TTProxy/TTProxy.h
===================================================================
--- trunk/TTProxy/TTProxy.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTProxy/TTProxy.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -6,7 +6,7 @@
 
 #include "ProxyWSockHook.h"
 
-extern BOOL PASCAL TTXBind(WORD Version, TTXExports* exports);
+extern "C" __declspec(dllexport) BOOL WINAPI TTXBind(WORD Version, TTXExports* exports);
 
 char UILanguageFile[MAX_PATH];
 
@@ -48,7 +48,7 @@
 
 	static void add_error_message(const char* message) {
 		if (getInstance().error_message != NULL) {
-			StringBuffer buffer = getInstance().error_message;
+			StringBuffer buffer = (const TCHAR *)getInstance().error_message;
 			buffer.append("\n\n");
 			buffer.append(message);
 			getInstance().error_message = buffer.toString();

Modified: trunk/TTProxy/YCL/include/YCL/Array.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/Array.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTProxy/YCL/include/YCL/Array.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -53,17 +53,21 @@
 			array[i] = source[i];
 		}
 	}
+#if 0
 	void copyFrom(Array* source) {
 		copy(source->array[i]);
 	}
+#endif
 	void copyTo(TYPE distination[])const {
 		for (int i = 0; i < length; i++) {
 			distination[i] = array[i];
 		}
 	}
+#if 0
 	void copyTo(Array* distination)const {
 		copyTo(distination->array[i]);
 	}
+#endif
 };
 
 }

Modified: trunk/TTProxy/YCL/include/YCL/HASHCODE.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/HASHCODE.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTProxy/YCL/include/YCL/HASHCODE.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -25,7 +25,7 @@
 	}
 	HASHCODE(const HASHCODE& code):value(code.value) {
 	}
-	HASHCODE(void* value):value((int) value) {
+	HASHCODE(const void* value):value((int)(uintptr_t) value) {
 	}
 	HASHCODE(int value):value(value) {
 	}

Modified: trunk/TTProxy/YCL/include/YCL/Hashtable.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/Hashtable.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTProxy/YCL/include/YCL/Hashtable.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -122,7 +122,7 @@
 	//	\x91S\x82ẴG\x83\x93\x83g\x83\x8A\x82\xAA\x90ݒ\xE8\x8Dς݂\xC5key\x82Ɠ\x99\x82\xB5\x82\xA2\x82\xE0\x82̂\xAA\x82Ȃ\xAF\x82\xEA\x82\xCE-1\x82\xF0\x95Ԃ\xB7\x81B
 	int find(const TYPE_KEY& key)const {
 		int found = -1;
-		int h = HASHCODE(key);
+		int h = HASHCODE(&key);
 		for (int i = 0; i < backetSize; i++) {
 			int index = ((unsigned) h + i) % backetSize;
 			const TYPE_KEY& bkey = backet[index].key;

Modified: trunk/TTXKanjiMenu/CMakeLists.txt
===================================================================
--- trunk/TTXKanjiMenu/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXKanjiMenu/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -24,6 +24,12 @@
   ${SRC}
   )
 
+set_target_properties(
+  ttxkanjimenu
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   ttxkanjimenu
   ttpcmn

Modified: trunk/TTXSamples/TTXAdditionalTitle/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXAdditionalTitle/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXAdditionalTitle/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,9 +18,14 @@
   ${SRC}
   )
 
+set_target_properties(
+  TTXAdditionalTitle
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   TTXAdditionalTitle
   ttpcmn
   )
 
-

Modified: trunk/TTXSamples/TTXAlwaysOnTop/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXAlwaysOnTop/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXAlwaysOnTop/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -22,6 +22,12 @@
   ${SRC}
   )
 
+set_target_properties(
+  TTXAlwaysOnTop
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   TTXAlwaysOnTop
   ttpcmn

Modified: trunk/TTXSamples/TTXCallSysMenu/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXCallSysMenu/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXCallSysMenu/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -17,3 +17,9 @@
   TTXCallSysMenu SHARED
   ${SRC}
   )
+
+set_target_properties(
+  TTXCallSysMenu
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXCommandLineOpt/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXCommandLineOpt/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXCommandLineOpt/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,6 +18,12 @@
   ${SRC}
   )
 
+set_target_properties(
+  TTXCommandLineOpt
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   TTXCommandLineOpt
   ttpcmn

Modified: trunk/TTXSamples/TTXCopyIniFile/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXCopyIniFile/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXCopyIniFile/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,4 +18,8 @@
   ${SRC}
   )
 
-
+set_target_properties(
+  TTXCopyIniFile
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXFixedWinSize/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXFixedWinSize/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXFixedWinSize/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,4 +18,8 @@
   ${SRC}
   )
 
-
+set_target_properties(
+  TTXFixedWinSize
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXKcodeChange/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXKcodeChange/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXKcodeChange/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,4 +18,8 @@
   ${SRC}
   )
 
-
+set_target_properties(
+  TTXKcodeChange
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXOutputBuffering/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXOutputBuffering/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXOutputBuffering/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,4 +18,8 @@
   ${SRC}
   )
 
-
+set_target_properties(
+  TTXOutputBuffering
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXRecurringCommand/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXRecurringCommand/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXRecurringCommand/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -34,6 +34,12 @@
   ${COMMON_SRC}
   )
 
+set_target_properties(
+  TTXRecurringCommand
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   TTXRecurringCommand
   ttpcmn

Modified: trunk/TTXSamples/TTXResizeMenu/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXResizeMenu/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXResizeMenu/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -22,6 +22,12 @@
   ${SRC}
   )
 
+set_target_properties(
+  TTXResizeMenu
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   TTXResizeMenu
   ttpcmn

Modified: trunk/TTXSamples/TTXResizeWin/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXResizeWin/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXResizeWin/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,4 +18,8 @@
   ${SRC}
   )
 
-
+set_target_properties(
+  TTXResizeWin
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXShowCommandLine/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXShowCommandLine/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXShowCommandLine/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -18,4 +18,8 @@
   ${SRC}
   )
 
-
+set_target_properties(
+  TTXShowCommandLine
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXViewMode/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXViewMode/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXViewMode/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -20,3 +20,9 @@
   TTXViewMode SHARED
   ${SRC}
   )
+
+set_target_properties(
+  TTXViewMode
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/TTXSamples/TTXttyrec/TTXttyplay.c
===================================================================
--- trunk/TTXSamples/TTXttyrec/TTXttyplay.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXttyrec/TTXttyplay.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -106,7 +106,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;
@@ -131,11 +131,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;
@@ -189,7 +190,7 @@
 	}
 
 	if (!pvar->nowait) {
-		gettimeofday(&curtime, NULL);
+		gettimeofday(&curtime /*, NULL*/ );
 		tdiff = tvdiff(pvar->last, curtime);
 	}
 

Modified: trunk/TTXSamples/TTXttyrec/TTXttyrec.c
===================================================================
--- trunk/TTXSamples/TTXttyrec/TTXttyrec.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXttyrec/TTXttyrec.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -106,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: trunk/TTXSamples/TTXttyrec/gettimeofday.c
===================================================================
--- trunk/TTXSamples/TTXttyrec/gettimeofday.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXttyrec/gettimeofday.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -1,9 +1,15 @@
 #include "gettimeofday.h"
 
-int gettimeofday(struct timeval *tv, struct timezone *tz) {
+// unix time epoch from windows file time 
+#if defined(_MSC_VER)
+#define FTEPOCHDIFF 116444736000000000i64
+#else
+#define FTEPOCHDIFF 116444736000000000LL
+#endif
+
+int gettimeofday(struct timeval *tv /*, struct timezone *tz*/ ) {
 	FILETIME ft;
 	__int64 t;
-	int tzsec, dst;
 
 	if (tv) {
 		GetSystemTimeAsFileTime(&ft);
@@ -12,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;
@@ -21,6 +30,7 @@
 			return -1;
 		}
 	}
+#endif
 
 	return 0;
 }

Modified: trunk/TTXSamples/TTXttyrec/gettimeofday.h
===================================================================
--- trunk/TTXSamples/TTXttyrec/gettimeofday.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/TTXttyrec/gettimeofday.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -3,14 +3,14 @@
 #include <windows.h>
 #include <time.h>
 
+#if defined(_MSC_VER)
 struct timezone {
     int tz_minuteswest;
     int tz_dsttime;
 };
+#endif
 
-#define FTEPOCHDIFF 116444736000000000i64
-
-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);

Modified: trunk/TTXSamples/ttxtest/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/ttxtest/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/TTXSamples/ttxtest/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -11,3 +11,9 @@
   TTXtest SHARED
   TTXtest.c
   )
+
+set_target_properties(
+  TTXtest
+  PROPERTIES
+  PREFIX ""
+  )

Modified: trunk/teraterm/CMakeLists.txt
===================================================================
--- trunk/teraterm/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -14,7 +14,7 @@
   ttpset
   PROPERTIES FOLDER teraterm)
 
-if(NOT(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" AND ${CMAKE_MAKE_PROGRAM} MATCHES "VCExpress.exe"))
+if((NOT(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" AND ${CMAKE_MAKE_PROGRAM} MATCHES "VCExpress.exe")) AND (NOT(MINGW)))
   # MFCを使用しているため VS2005 Express ではビルドできない
   add_subdirectory(ttpmacro)
   set_target_properties(
@@ -36,6 +36,3 @@
 set_target_properties(
   keycode
   PROPERTIES FOLDER teraterm)
-
-# ttpdlg内でconfig時 svnversion.h を生成
-#add_subdirectory(svnrev)

Modified: trunk/teraterm/common/i18n.c
===================================================================
--- trunk/teraterm/common/i18n.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/i18n.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -47,7 +47,7 @@
 }
 #endif
 
-void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile)
+DllExport void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile)
 {
 	GetPrivateProfileStringA(section, key, def, buf, buf_len, iniFile);
 	RestoreNewLine(buf);

Modified: trunk/teraterm/common/i18n.h
===================================================================
--- trunk/teraterm/common/i18n.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/i18n.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -37,6 +37,10 @@
 extern "C" {
 #endif
 
+#if !defined(DllExport)
+#define DllExport __declspec(dllexport)
+#endif
+
 typedef struct {
 	int nIDDlgItem;
 	const char *key;
@@ -43,13 +47,13 @@
 } DlgTextInfo;
 
 #if defined(UNICODE)
-void GetI18nStrW(const char *section, const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile);
+DllExport void GetI18nStrW(const char *section, const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile);
 #endif
-void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
-int GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile);
-void SetI18DlgStrs(const char *section, HWND hDlgWnd,
+DllExport void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
+DllExport int GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile);
+DllExport void SetI18DlgStrs(const char *section, HWND hDlgWnd,
 							 const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
-void SetI18MenuStrs(const char *section, HMENU hMenu,
+DllExport void SetI18MenuStrs(const char *section, HMENU hMenu,
 							  const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
 
 #if defined(_UNICODE)

Modified: trunk/teraterm/common/servicenames.h
===================================================================
--- trunk/teraterm/common/servicenames.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/servicenames.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -32,10 +32,13 @@
 extern "C" {
 #endif
 
+#if !defined(DllExport)
+#define DllExport __declspec(dllexport)
+#endif
 /* proto types */
-int PASCAL parse_port(char *str, char *buf, int bufsize);
-int PASCAL parse_port_from_buf(char *buf);
-char * PASCAL service_name(int num);
+DllExport int PASCAL parse_port(char *str, char *buf, int bufsize);
+DllExport int PASCAL parse_port_from_buf(char *buf);
+DllExport char * PASCAL service_name(int num);
 
 #ifdef __cplusplus
 }

Modified: trunk/teraterm/common/ttcommon.h
===================================================================
--- trunk/teraterm/common/ttcommon.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/ttcommon.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -34,72 +34,71 @@
 extern "C" {
 #endif
 
-int PASCAL DetectComPorts(LPWORD ComPortTable, int ComPortMax, char **ComPortDesc);
-int PASCAL CheckComPort(WORD ComPort);
-void PASCAL CopyShmemToTTSet(PTTSet ts);
-void PASCAL CopyTTSetToShmem(PTTSet ts);
-BOOL PASCAL StartTeraTerm(PTTSet ts);
-void PASCAL RestartTeraTerm(HWND hwnd, PTTSet ts);
-void PASCAL ChangeDefaultSet(PTTSet ts, PKeyMap km);
-void PASCAL GetDefaultSet(PTTSet ts);
+#if !defined(DllExport)
+#define DllExport __declspec(dllimport)
+#endif
+
+DllExport int PASCAL DetectComPorts(LPWORD ComPortTable, int ComPortMax, char **ComPortDesc);
+DllExport int PASCAL CheckComPort(WORD ComPort);
+DllExport void PASCAL CopyShmemToTTSet(PTTSet ts);
+DllExport void PASCAL CopyTTSetToShmem(PTTSet ts);
+DllExport BOOL PASCAL StartTeraTerm(PTTSet ts);
+DllExport void PASCAL RestartTeraTerm(HWND hwnd, PTTSet ts);
+DllExport void PASCAL ChangeDefaultSet(PTTSet ts, PKeyMap km);
+DllExport void PASCAL GetDefaultSet(PTTSet ts);
 // void PASCAL LoadDefaultSet(PCHAR SetupFName);
-WORD PASCAL GetKeyCode(PKeyMap KeyMap, WORD Scan);
-void PASCAL GetKeyStr(HWND HWin, PKeyMap KeyMap, WORD KeyCode,
+DllExport WORD PASCAL GetKeyCode(PKeyMap KeyMap, WORD Scan);
+DllExport void PASCAL GetKeyStr(HWND HWin, PKeyMap KeyMap, WORD KeyCode,
                           BOOL AppliKeyMode, BOOL AppliCursorMode,
                           BOOL Send8BitMode, PCHAR KeyStr,
                           int destlen, LPINT Len, LPWORD Type);
 
-void PASCAL SetCOMFlag(int com);
-void PASCAL ClearCOMFlag(int com);
-int PASCAL CheckCOMFlag(int com);
+DllExport void PASCAL SetCOMFlag(int com);
+DllExport void PASCAL ClearCOMFlag(int com);
+DllExport int PASCAL CheckCOMFlag(int com);
 
-int PASCAL RegWin(HWND HWinVT, HWND HWinTEK);
-void PASCAL UnregWin(HWND HWin);
-void PASCAL SetWinMenu(HMENU menu, PCHAR buf, int buflen, PCHAR langFile, int VTFlag);
-void PASCAL SetWinList(HWND HWin, HWND HDlg, int IList);
-void PASCAL SelectWin(int WinId);
-void PASCAL SelectNextWin(HWND HWin, int Next, BOOL SkipIconic);
-HWND PASCAL GetNthWin(int n);
-int PASCAL GetRegisteredWindowCount();
-void PASCAL ShowAllWin(int stat);
-void PASCAL ShowAllWinSidebySide(HWND);
-void PASCAL ShowAllWinStacked(HWND);
-void PASCAL ShowAllWinCascade(HWND);
-void PASCAL BroadcastClosingMessage(HWND myhwnd);
-void PASCAL UndoAllWin();
-void PASCAL OpenHelp(UINT Command, DWORD Data, char *UILanguageFile);
+DllExport int PASCAL RegWin(HWND HWinVT, HWND HWinTEK);
+DllExport void PASCAL UnregWin(HWND HWin);
+DllExport void PASCAL SetWinMenu(HMENU menu, PCHAR buf, int buflen, PCHAR langFile, int VTFlag);
+DllExport void PASCAL SetWinList(HWND HWin, HWND HDlg, int IList);
+DllExport void PASCAL SelectWin(int WinId);
+DllExport void PASCAL SelectNextWin(HWND HWin, int Next, BOOL SkipIconic);
+DllExport HWND PASCAL GetNthWin(int n);
+DllExport int PASCAL GetRegisteredWindowCount();
+DllExport void PASCAL ShowAllWin(int stat);
+DllExport void PASCAL ShowAllWinSidebySide(HWND);
+DllExport void PASCAL ShowAllWinStacked(HWND);
+DllExport void PASCAL ShowAllWinCascade(HWND);
+DllExport void PASCAL BroadcastClosingMessage(HWND myhwnd);
+DllExport void PASCAL UndoAllWin();
+DllExport void PASCAL OpenHelp(UINT Command, DWORD Data, char *UILanguageFile);
 
-int PASCAL CommReadRawByte(PComVar cv, LPBYTE b);
-int PASCAL CommRead1Byte(PComVar cv, LPBYTE b);
-void PASCAL CommInsert1Byte(PComVar cv, BYTE b);
-int PASCAL CommRawOut(PComVar cv, PCHAR B, int C);
-int PASCAL CommBinaryOut(PComVar cv, PCHAR B, int C);
-int PASCAL CommBinaryBuffOut(PComVar cv, PCHAR B, int C);
-int PASCAL CommTextOut(PComVar cv, PCHAR B, int C);
-int PASCAL CommTextOutW(PComVar cv, const wchar_t *B, int C);
-int PASCAL CommBinaryEcho(PComVar cv, PCHAR B, int C);
-int PASCAL CommTextEcho(PComVar cv, PCHAR B, int C);
-int PASCAL CommTextEchoW(PComVar cv, const wchar_t *B, int C);
+DllExport int PASCAL CommReadRawByte(PComVar cv, LPBYTE b);
+DllExport int PASCAL CommRead1Byte(PComVar cv, LPBYTE b);
+DllExport void PASCAL CommInsert1Byte(PComVar cv, BYTE b);
+DllExport int PASCAL CommRawOut(PComVar cv, PCHAR B, int C);
+DllExport int PASCAL CommBinaryOut(PComVar cv, PCHAR B, int C);
+DllExport int PASCAL CommBinaryBuffOut(PComVar cv, PCHAR B, int C);
+DllExport int PASCAL CommTextOut(PComVar cv, PCHAR B, int C);
+DllExport int PASCAL CommTextOutW(PComVar cv, const wchar_t *B, int C);
+DllExport int PASCAL CommBinaryEcho(PComVar cv, PCHAR B, int C);
+DllExport int PASCAL CommTextEcho(PComVar cv, PCHAR B, int C);
+DllExport int PASCAL CommTextEchoW(PComVar cv, const wchar_t *B, int C);
 
-void PASCAL CreateNotifyIcon(PComVar cv);
-void PASCAL DeleteNotifyIcon(PComVar cv);
-void PASCAL NotifyMessage(PComVar cv, PCHAR message, PCHAR title, DWORD flag);
-void PASCAL ShowNotifyIcon(PComVar cv);
-void PASCAL HideNotifyIcon(PComVar cv);
-void PASCAL SetVerNotifyIcon(PComVar cv, unsigned int ver);
-void PASCAL SetCustomNotifyIcon(HICON icon);
-HICON PASCAL GetCustomNotifyIcon();
+DllExport void PASCAL CreateNotifyIcon(PComVar cv);
+DllExport void PASCAL DeleteNotifyIcon(PComVar cv);
+DllExport void PASCAL NotifyMessage(PComVar cv, PCHAR message, PCHAR title, DWORD flag);
+DllExport void PASCAL ShowNotifyIcon(PComVar cv);
+DllExport void PASCAL HideNotifyIcon(PComVar cv);
+DllExport void PASCAL SetVerNotifyIcon(PComVar cv, unsigned int ver);
+DllExport void PASCAL SetCustomNotifyIcon(HICON icon);
+DllExport HICON PASCAL GetCustomNotifyIcon();
 
 #define NotifyInfoMessage(cv, msg, title) NotifyMessage(cv, msg, title, 1)
 #define NotifyWarnMessage(cv, msg, title) NotifyMessage(cv, msg, title, 2)
 #define NotifyErrorMessage(cv, msg, title) NotifyMessage(cv, msg, title, 3)
 
-WORD PASCAL SJIS2JIS(WORD KCode);
-WORD PASCAL SJIS2EUC(WORD KCode);
-WORD PASCAL JIS2SJIS(WORD KCode);
-BYTE PASCAL RussConv(int cin, int cout, BYTE b);
-void PASCAL RussConvStr
-  (int cin, int cout, PCHAR Str, int count);
+#include "../ttpcmn/language.h"
 
 #ifdef __cplusplus
 }

Modified: trunk/teraterm/common/ttftypes.h
===================================================================
--- trunk/teraterm/common/ttftypes.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/ttftypes.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -133,7 +133,7 @@
   DWORD StartTime;
 
   // log rotate
-  enum rotate_mode RotateMode;
+  int RotateMode;  //  enum rotate_mode RotateMode;
   LONG RotateSize;
   int RotateStep;
 

Modified: trunk/teraterm/common/ttlib.h
===================================================================
--- trunk/teraterm/common/ttlib.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/ttlib.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -37,9 +37,13 @@
 extern "C" {
 #endif
 
+#if !defined(DllExport)
+#define DllExport __declspec(dllexport)
+#endif
+
 BOOL GetFileNamePos(PCHAR PathName, int far *DirLen, int far *FNPos);
-BOOL ExtractFileName(PCHAR PathName, PCHAR FileName, int destlen);
-BOOL ExtractDirName(PCHAR PathName, PCHAR DirName);
+DllExport BOOL ExtractFileName(PCHAR PathName, PCHAR FileName, int destlen);
+DllExport BOOL ExtractDirName(PCHAR PathName, PCHAR DirName);
 void FitFileName(PCHAR FileName, int destlen, const char *DefExt);
 void AppendSlash(PCHAR Path, int destlen);
 void DeleteSlash(PCHAR Path);
@@ -57,7 +61,7 @@
 #endif
 int isInvalidFileNameChar(PCHAR FName);
 #define deleteInvalidFileNameChar(name) replaceInvalidFileNameChar(name, 0)
-void replaceInvalidFileNameChar(PCHAR FName, unsigned char c);
+DllExport void replaceInvalidFileNameChar(PCHAR FName, unsigned char c);
 int isInvalidStrftimeChar(PCHAR FName);
 void deleteInvalidStrftimeChar(PCHAR FName);
 void ParseStrftimeFileName(PCHAR FName, int destlen);
@@ -76,32 +80,33 @@
 void get_lang_msgW(const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile);
 #endif
 int get_lang_font(PCHAR key, HWND dlg, PLOGFONT logfont, HFONT *font, const char *iniFile);
-BOOL doSelectFolder(HWND hWnd, char *path, int pathlen, const char *def, const char *msg);
-void OutputDebugPrintf(const char *fmt, ...);
-DWORD get_OPENFILENAME_SIZEA();
-BOOL IsWindows95();
-BOOL IsWindowsMe();
-BOOL IsWindowsNT4();
-BOOL IsWindowsNTKernel();
-BOOL IsWindows2000();
-BOOL IsWindows2000OrLater();
-BOOL IsWindowsVistaOrLater();
-BOOL IsWindows7OrLater();
-BOOL HasMultiMonitorSupport();
-BOOL HasGetAdaptersAddresses();
-BOOL HasDnsQuery();
-BOOL HasBalloonTipSupport();
+DllExport BOOL doSelectFolder(HWND hWnd, char *path, int pathlen, const char *def, const char *msg);
+DllExport void OutputDebugPrintf(const char *fmt, ...);
+DllExport DWORD get_OPENFILENAME_SIZEA();
+DllExport DWORD get_OPENFILENAME_SIZEW();
+DllExport BOOL IsWindows95();
+DllExport BOOL IsWindowsMe();
+DllExport BOOL IsWindowsNT4();
+DllExport BOOL IsWindowsNTKernel();
+DllExport BOOL IsWindows2000();
+DllExport BOOL IsWindows2000OrLater();
+DllExport BOOL IsWindowsVistaOrLater();
+DllExport BOOL IsWindows7OrLater();
+DllExport BOOL HasMultiMonitorSupport();
+DllExport BOOL HasGetAdaptersAddresses();
+DllExport BOOL HasDnsQuery();
+DllExport BOOL HasBalloonTipSupport();
 int KanjiCode2List(int lang, int kcode);
 int List2KanjiCode(int lang, int kcode);
 int KanjiCodeTranslate(int lang, int kcode);
-char *mctimelocal(char *format, BOOL utc_flag);
+DllExport char *mctimelocal(char *format, BOOL utc_flag);
 char *strelapsed(DWORD start_time);
 
 void b64encode(PCHAR dst, int dsize, PCHAR src, int len);
-int b64decode(PCHAR dst, int dsize, PCHAR src);
+DllExport int b64decode(PCHAR dst, int dsize, PCHAR src);
 
-PCHAR PASCAL GetParam(PCHAR buff, int size, PCHAR param);
-void PASCAL DequoteParam(PCHAR dest, int dest_len, PCHAR src);
+DllExport PCHAR PASCAL GetParam(PCHAR buff, int size, PCHAR param);
+DllExport void PASCAL DequoteParam(PCHAR dest, int dest_len, PCHAR src);
 void PASCAL DeleteComment(PCHAR dest, int dest_size, PCHAR src);
 
 void split_buffer(char *buffer, int delimiter, char **head, char **body);
@@ -108,7 +113,7 @@
 BOOL GetPositionOnWindow(
 	HWND hWnd, const POINT *point,
 	BOOL *InWindow, BOOL *InClient, BOOL *InTitleBar);
-void GetMessageboxFont(LOGFONTA *logfont);
+DllExport void GetMessageboxFont(LOGFONTA *logfont);
 
 #define CheckFlag(var, flag)	(((var) & (flag)) != 0)
 

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/common/tttypes.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -644,7 +644,7 @@
 	WORD FontQuality;
 	char ScpSendDir[MAXPATHLEN];
 	char BGImageFilePath[MAX_PATH];
-	enum rotate_mode LogRotate;
+	int LogRotate;		//	enum rotate_mode LogRotate;
 	DWORD LogRotateSize;
 	WORD LogRotateSizeType;
 	WORD LogRotateStep;
@@ -1018,7 +1018,7 @@
 	BOOL Open;
 	WORD PortType;
 	WORD ComPort;
-	unsigned int s; /* SOCKET */
+	UINT_PTR s; /* SOCKET */
 	WORD RetryCount;
 	HANDLE ComID;
 	BOOL CanSend, RRQ;

Deleted: trunk/teraterm/svnrev/CMakeLists.txt
===================================================================
--- trunk/teraterm/svnrev/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/svnrev/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -1,23 +0,0 @@
-project(svnrev)
-
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
-
-set(SRC
-  svnrev.cpp
-  svnrev.h
-  )
-
-include_directories(
-  ../common
-  ../ttpfile
-  .
-  )
-
-add_executable(
-  svnrev
-  ${SRC}
-  )
-
-target_link_libraries(
-  svnrev
-  )

Modified: trunk/teraterm/teraterm/ttplug.c
===================================================================
--- trunk/teraterm/teraterm/ttplug.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/teraterm/ttplug.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -72,7 +72,12 @@
   if (NumExtensions>=MAXNUMEXTENSIONS) return;
   LibHandle[NumExtensions] = LoadLibrary(fileName);
   if (LibHandle[NumExtensions] != NULL) {
-    TTXBindProc bind = (TTXBindProc)GetProcAddress(LibHandle[NumExtensions], "_TTXBind @ 8");
+#if defined(_MSC_VER)
+    const char *TTXBIND = "_TTXBind @ 8";
+#else
+    const char *TTXBIND = "TTXBind @ 8";
+#endif
+    TTXBindProc bind = (TTXBindProc)GetProcAddress(LibHandle[NumExtensions], TTXBIND);
     if (bind==NULL)
       bind = (TTXBindProc)GetProcAddress(LibHandle[NumExtensions], "TTXBind");
     if (bind != NULL) {

Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/teraterm/vtdisp.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -447,9 +447,9 @@
   if(!hSPI)
     goto error;
 
-  (FARPROC)SPI_GetPluginInfo = GetProcAddress(hSPI,"GetPluginInfo");
-  (FARPROC)SPI_IsSupported   = GetProcAddress(hSPI,"IsSupported");
-  (FARPROC)SPI_GetPicture    = GetProcAddress(hSPI,"GetPicture");
+  SPI_GetPluginInfo = (void *)GetProcAddress(hSPI,"GetPluginInfo");
+  SPI_IsSupported   = (void *)GetProcAddress(hSPI,"IsSupported");
+  SPI_GetPicture    = (void *)GetProcAddress(hSPI,"GetPicture");
 
   if(!SPI_GetPluginInfo || !SPI_IsSupported || !SPI_GetPicture)
     goto error;

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-04-01 12:45:02 UTC (rev 7536)
@@ -2148,10 +2148,9 @@
 	for (int i = 0; i < DropListCount; i++) {
 		const char *FileName = DropLists[i];
 		const DWORD attr = GetFileAttributes(FileName);
-		if (attr == -1 ) {
-			goto finish;
-		}
-		if (attr & FILE_ATTRIBUTE_DIRECTORY) {
+		if (attr == (DWORD)-1 ) {
+			FileCount++;
+		} else if (attr & FILE_ATTRIBUTE_DIRECTORY) {
 			DirectoryCount++;
 		} else {
 			FileCount++;

Modified: trunk/teraterm/teraterm/winjump.c
===================================================================
--- trunk/teraterm/teraterm/winjump.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/teraterm/winjump.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -51,11 +51,18 @@
 #include <stdio.h>
 #include <string.h>
 #include <shlobj.h>
+#include <crtdbg.h>
 
 #include "winjump.h"
 #include "teraterm.h"
 #include "tttypes.h"
 
+#ifdef _DEBUG
+#define malloc(l)	_malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__)
+#define free(p)		_free_dbg((p), _NORMAL_BLOCK)
+#define _strdup(s)	_strdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
+#endif
+
 #define MAX_JUMPLIST_ITEMS 30 /* PuTTY will never show more items in
                                * the jumplist than this, regardless of
                                * user preferences. */
@@ -368,6 +375,7 @@
 } IPropertyStore;
 #endif
 
+#if !defined(__MINGW32__)
 static const CLSID CLSID_DestinationList = {
     0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}
 };
@@ -383,9 +391,13 @@
 static const IID IID_IShellLink = {
     0x000214ee, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}
 };
+#endif
+#if (NTDDI_VERSION < NTDDI_WIN7)
 static const IID IID_ICustomDestinationList = {
     0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}
 };
+#endif
+#if !defined(__MINGW32__)
 static const IID IID_IObjectArray = {
     0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}
 };
@@ -392,6 +404,7 @@
 static const IID IID_IPropertyStore = {
     0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}
 };
+#endif
 static const PROPERTYKEY PKEY_Title = {
     {0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}},
     0x00000002

Modified: trunk/teraterm/ttpcmn/CMakeLists.txt
===================================================================
--- trunk/teraterm/ttpcmn/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/ttpcmn/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -30,7 +30,6 @@
   )
 
 set(SRC
-  ttpcmn.def
   cmn_res.h
   language.c
   language.h

Modified: trunk/teraterm/ttpcmn/language.c
===================================================================
--- trunk/teraterm/ttpcmn/language.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/ttpcmn/language.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -29,16 +29,17 @@
 
 // TTCMN.DLL character code conversion
 
+#include <mbstring.h>
+#include <locale.h>
 #include "teraterm.h"
 #include "tttypes.h"
-#include <mbstring.h>
-#include <locale.h>
 #include "codemap.h"
 
+#define DllExport __declspec(dllexport)
 #include "language.h"
 
 // export\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9
-unsigned short ConvertUnicode(unsigned short code, const codemap_t *table, int tmax)
+DllExport unsigned short ConvertUnicode(unsigned short code, const codemap_t *table, int tmax)
 {
 	int low, mid, high;
 	unsigned short result;
@@ -65,7 +66,7 @@
 }
 
 // Japanese SJIS -> JIS
-WORD PASCAL SJIS2JIS(WORD KCode)
+DllExport WORD PASCAL SJIS2JIS(WORD KCode)
 {
 	WORD x0,x1,x2,y0;
 	BYTE b = LOBYTE(KCode);
@@ -92,13 +93,13 @@
 }
 
 // Japanese SJIS -> EUC
-WORD PASCAL SJIS2EUC(WORD KCode)
+DllExport WORD PASCAL SJIS2EUC(WORD KCode)
 {
 	return (SJIS2JIS(KCode) | 0x8080);
 }
 
 // Japanese JIS -> SJIS
-WORD PASCAL JIS2SJIS(WORD KCode)
+DllExport WORD PASCAL JIS2SJIS(WORD KCode)
 {
 	WORD n1, n2, SJIS;
 
@@ -532,7 +533,7 @@
 };
 
 // Russian character set conversion
-BYTE PASCAL RussConv(int cin, int cout, BYTE b)
+DllExport BYTE PASCAL RussConv(int cin, int cout, BYTE b)
 // cin: input character set (IdWindows/IdKOI8/Id866/IdISO)
 // cin: output character set (IdWindows/IdKOI8/Id866/IdISO)
 {
@@ -543,7 +544,7 @@
 }
 
 // Russian character set conversion for a character string
-void PASCAL RussConvStr(int cin, int cout, PCHAR Str, int count)
+DllExport void PASCAL RussConvStr(int cin, int cout, PCHAR Str, int count)
 // cin: input character set (IdWindows/IdKOI8/Id866/IdISO)
 // cin: output character set (IdWindows/IdKOI8/Id866/IdISO)
 {

Modified: trunk/teraterm/ttpcmn/language.h
===================================================================
--- trunk/teraterm/ttpcmn/language.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/ttpcmn/language.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -29,17 +29,22 @@
 
 /* TTCMN.DLL, character code conversion */
 
-#include "codemap.h"
+#pragma once
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#if !defined(DllExport)
+#define DllExport __declspec(dllimport)
+#endif
+
 /* proto types */
-WORD PASCAL SJIS2JIS(WORD KCode);
-WORD PASCAL SJIS2EUC(WORD KCode);
-WORD PASCAL JIS2SJIS(WORD KCode);
-BYTE PASCAL RussConv(int cin, int cout, BYTE b);
-void PASCAL RussConvStr(int cin, int cout, PCHAR Str, int count);
+DllExport WORD PASCAL SJIS2JIS(WORD KCode);
+DllExport WORD PASCAL SJIS2EUC(WORD KCode);
+DllExport WORD PASCAL JIS2SJIS(WORD KCode);
+DllExport BYTE PASCAL RussConv(int cin, int cout, BYTE b);
+DllExport void PASCAL RussConvStr(int cin, int cout, PCHAR Str, int count);
 
 #ifdef __cplusplus
 }

Modified: trunk/teraterm/ttpcmn/ttcmn.c
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/teraterm/ttpcmn/ttcmn.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -32,13 +32,8 @@
 #endif
 
 /* TTCMN.DLL, main */
-#include "teraterm.h"
-#include "tttypes.h"
 #include <direct.h>
 #include <string.h>
-#include "ttftypes.h"
-#include "ttlib.h"
-#include "language.h"
 #include <stdio.h>
 #include <windows.h>
 #include <tchar.h>
@@ -46,11 +41,22 @@
 #include <locale.h>
 #include <htmlhelp.h>
 
+#define DllExport __declspec(dllexport)
+#include "language.h"
+#undef DllExport
+
+#include "teraterm.h"
+#include "tttypes.h"
+#include "ttftypes.h"
+#include "ttlib.h"
 #include "compat_w95.h"
 #include "tt_res.h"
-#include "ttcommon.h"
 #include "codeconv.h"
 
+#define DllExport __declspec(dllexport)
+#include "ttcommon.h"
+
+
 // TMap \x82\xF0\x8Ai\x94[\x82\xB7\x82\xE9\x83t\x83@\x83C\x83\x8B\x83}\x83b\x83s\x83\x93\x83O\x83I\x83u\x83W\x83F\x83N\x83g(\x8B\xA4\x97L\x83\x81\x83\x82\x83\x8A)\x82̖\xBC\x91O
 // TMap(\x82Ƃ\xBB\x82̃\x81\x83\x93\x83o)\x82̍X\x90V\x8E\x9E\x82͋\x8C\x83o\x81[\x83W\x83\x87\x83\x93\x82Ƃ̓\xAF\x8E\x9E\x8BN\x93\xAE\x82ׂ̈ɕς\xA6\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82邪
 // \x98A\x94Ԃ\xA9\x82\xE7\x83o\x81[\x83W\x83\x87\x83\x93\x94ԍ\x86\x82\xF0\x8Eg\x82\xA4\x82悤\x82ɕύX\x82\xB5\x82\xBD\x88ׁA\x92ʏ\xED\x82͎蓮\x82ŕύX\x82\xB7\x82\xE9\x95K\x97v\x82͖\xB3\x82\xA2

Modified: trunk/ttssh2/ttxssh/CMakeLists.txt
===================================================================
--- trunk/ttssh2/ttxssh/CMakeLists.txt	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/CMakeLists.txt	2019-04-01 12:45:02 UTC (rev 7536)
@@ -117,6 +117,12 @@
   ${SRC}
   )
 
+set_target_properties(
+  ttxssh
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   ttxssh
   libputty

Modified: trunk/ttssh2/ttxssh/buffer.c
===================================================================
--- trunk/ttssh2/ttxssh/buffer.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/buffer.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -38,6 +38,10 @@
 #include <openssl/ec.h>
 #include <zlib.h>
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 // \x83o\x83b\x83t\x83@\x82̃I\x83t\x83Z\x83b\x83g\x82\xF0\x8F\x89\x8A\x{227B0B5}\x81A\x82܂\xBE\x93ǂ\xF1\x82ł\xA2\x82Ȃ\xA2\x8F\xF3\x91Ԃɂ\xB7\x82\xE9\x81B
 // Tera Term(TTSSH)\x83I\x83\x8A\x83W\x83i\x83\x8B\x8A֐\x94\x81B
 void buffer_rewind(buffer_t *buf)

Modified: trunk/ttssh2/ttxssh/fwd-socks.c
===================================================================
--- trunk/ttssh2/ttxssh/fwd-socks.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/fwd-socks.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -65,6 +65,10 @@
 #define SOCKS5_ERROR_COMMAND     129
 #define SOCKS5_ERROR_ADDRTYPE    130
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 typedef struct {
 	PTInstVar pvar;
 

Modified: trunk/ttssh2/ttxssh/fwd.c
===================================================================
--- trunk/ttssh2/ttxssh/fwd.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/fwd.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -47,6 +47,10 @@
 
 #define CHANNEL_READ_BUF_SIZE 8192
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 static LRESULT CALLBACK accept_wnd_proc(HWND wnd, UINT msg, WPARAM wParam,
                                         LPARAM lParam);
 

Modified: trunk/ttssh2/ttxssh/key.c
===================================================================
--- trunk/ttssh2/ttxssh/key.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/key.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -592,7 +592,7 @@
 	return TRUE;
 }
 
-char* key_fingerprint_raw(Key *k, enum digest_algorithm dgst_alg, int *dgst_raw_length)
+char* key_fingerprint_raw(Key *k, digest_algorithm dgst_alg, int *dgst_raw_length)
 {
 	const EVP_MD *md = NULL;
 	EVP_MD_CTX ctx;
@@ -879,7 +879,7 @@
 //
 // fingerprint\x81i\x8Ew\x96\xE4\x81F\x83z\x83X\x83g\x8C\xF6\x8AJ\x8C\xAE\x82̃n\x83b\x83V\x83\x85\x81j\x82𐶐\xAC\x82\xB7\x82\xE9
 //
-char *key_fingerprint(Key *key, enum fp_rep dgst_rep, enum digest_algorithm dgst_alg)
+char *key_fingerprint(Key *key, enum fp_rep dgst_rep, digest_algorithm dgst_alg)
 {
 	char *retval = NULL, *alg;
 	unsigned char *dgst_raw;

Modified: trunk/ttssh2/ttxssh/key.h
===================================================================
--- trunk/ttssh2/ttxssh/key.h	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/key.h	2019-04-01 12:45:02 UTC (rev 7536)
@@ -43,12 +43,12 @@
 unsigned char *duplicate_ED25519_PK(unsigned char *src);
 BOOL key_copy(Key *dest, Key *src);
 
-char *key_fingerprint_raw(Key *k, enum digest_algorithm dgst_alg, int *dgst_raw_length);
-char *key_fingerprint(Key *key, enum fp_rep dgst_rep, enum fp_type dgst_type);
+char *key_fingerprint_raw(Key *k, digest_algorithm dgst_alg, int *dgst_raw_length);
+char *key_fingerprint(Key *key, enum fp_rep dgst_rep, digest_algorithm dgst_alg);
 
 const char *ssh_key_type(ssh_keytype type);
 char *get_sshname_from_key(Key *key);
-enum hostkey_type get_keytype_from_name(char *name);
+ssh_keytype get_keytype_from_name(char *name);
 char *curve_keytype_to_name(ssh_keytype type);
 ssh_keytype key_curve_name_to_keytype(char *name);
 

Modified: trunk/ttssh2/ttxssh/keyfiles.c
===================================================================
--- trunk/ttssh2/ttxssh/keyfiles.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/keyfiles.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -388,7 +388,7 @@
 		len = fread(buf, 1, sizeof(buf), fp);
 		buffer_append(blob, buf, len);
 		if (buffer_len(blob) > MAX_KEY_FILE_SIZE) {
-			logprintf(LOG_LEVEL_WARNING, __FUNCTION__ ": key file too large.");
+			logprintf(LOG_LEVEL_WARNING, "%s: key file too large.", __FUNCTION__);
 			goto error;
 		}
 		if (len < sizeof(buf))
@@ -401,7 +401,7 @@
 	cp = buffer_ptr(blob);
 	len = buffer_len(blob);
 	if (len < m1len || memcmp(cp, MARK_BEGIN, m1len)) {
-		logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": missing begin marker");
+		logprintf(LOG_LEVEL_VERBOSE, "%s: missing begin marker", __FUNCTION__);
 		goto error;
 	}
 	cp += m1len;
@@ -420,7 +420,7 @@
 		}
 	}
 	if (!len) {
-		logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": no end marker");
+		logprintf(LOG_LEVEL_VERBOSE, "%s: no end marker", __FUNCTION__);
 		goto error;
 	}
 
@@ -427,15 +427,15 @@
 	// \x83t\x83@\x83C\x83\x8B\x82̃X\x83L\x83\x83\x83\x93\x82\xAA\x8FI\x82\xED\x82\xC1\x82\xBD\x82̂ŁAbase64 decode\x82\xB7\x82\xE9\x81B
 	len = buffer_len(encoded);
 	if ((cp = buffer_append_space(copy_consumed, len)) == NULL) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": buffer_append_space");
+		logprintf(LOG_LEVEL_ERROR, "%s: buffer_append_space", __FUNCTION__);
 		goto error;
 	}
 	if ((dlen = b64decode(cp, len, buffer_ptr(encoded))) < 0) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": base64 decode failed");
+		logprintf(LOG_LEVEL_ERROR, "%s: base64 decode failed", __FUNCTION__);
 		goto error;
 	}
 	if ((unsigned int)dlen > len) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": crazy base64 length %d > %u", dlen, len);
+		logprintf(LOG_LEVEL_ERROR, "%s: crazy base64 length %d > %u", __FUNCTION__, dlen, len);
 		goto error;
 	}
 
@@ -442,7 +442,7 @@
 	buffer_consume_end(copy_consumed, len - dlen);
 	if (buffer_remain_len(copy_consumed) < sizeof(AUTH_MAGIC) ||
 	    memcmp(buffer_tail_ptr(copy_consumed), AUTH_MAGIC, sizeof(AUTH_MAGIC))) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": bad magic");
+		logprintf(LOG_LEVEL_ERROR, "%s: bad magic", __FUNCTION__);
 		goto error;
 	}
 	buffer_consume(copy_consumed, sizeof(AUTH_MAGIC));
@@ -467,11 +467,11 @@
 	kdfname = buffer_get_string_msg(copy_consumed, NULL);
 	if (kdfname == NULL ||
 	    (!strcmp(kdfname, "none") && !strcmp(kdfname, KDFNAME))) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": unknown kdf name");
+		logprintf(LOG_LEVEL_ERROR, "%s: unknown kdf name", __FUNCTION__ );
 		goto error;
 	}
 	if (!strcmp(kdfname, "none") && strcmp(ciphername, "none") != 0) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ "%s: cipher %s requires kdf", ciphername);
+		logprintf(LOG_LEVEL_ERROR, "%s: cipher %s requires kdf", __FUNCTION__, ciphername);
 		goto error;
 	}
 
@@ -478,12 +478,12 @@
 	/* kdf options */
 	kdfp = buffer_get_string_msg(copy_consumed, &klen);
 	if (kdfp == NULL) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": kdf options not set");
+		logprintf(LOG_LEVEL_ERROR, "%s: kdf options not set", __FUNCTION__);
 		goto error;
 	}
 	if (klen > 0) {
 		if ((cp = buffer_append_space(kdf, klen)) == NULL) {
-			logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": kdf alloc failed");
+			logprintf(LOG_LEVEL_ERROR, "%s: kdf alloc failed", __FUNCTION__);
 			goto error;
 		}
 		memcpy(cp, kdfp, klen);
@@ -491,11 +491,11 @@
 
 	/* number of keys */
 	if (buffer_get_int_ret(&nkeys, copy_consumed) < 0) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": key counter missing");
+		logprintf(LOG_LEVEL_ERROR, "%s: key counter missing", __FUNCTION__);
 		goto error;
 	}
 	if (nkeys != 1) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": only one key supported");
+		logprintf(LOG_LEVEL_ERROR, "%s: only one key supported", __FUNCTION__);
 		goto error;
 	}
 
@@ -502,7 +502,7 @@
 	/* pubkey */
 	cp = buffer_get_string_msg(copy_consumed, &len);
 	if (cp == NULL) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": pubkey not found");
+		logprintf(LOG_LEVEL_ERROR, "%s: pubkey not found", __FUNCTION__);
 		goto error;
 	}
 	free(cp); /* XXX check pubkey against decrypted private key */
@@ -512,11 +512,11 @@
 	blocksize = get_cipher_block_size(cipher);
 	authlen = 0;  // TODO: \x82Ƃ肠\x82\xA6\x82\xB8\x8CŒ艻
 	if (len < blocksize) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": encrypted data too small");
+		logprintf(LOG_LEVEL_ERROR, "%s: encrypted data too small", __FUNCTION__);
 		goto error;
 	}
 	if (len % blocksize) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": length not multiple of blocksize");
+		logprintf(LOG_LEVEL_ERROR, "%s: length not multiple of blocksize", __FUNCTION__);
 		goto error;
 	}
 
@@ -527,7 +527,7 @@
 	if (!strcmp(kdfname, KDFNAME)) {
 		salt = buffer_get_string_msg(kdf, &slen);
 		if (salt == NULL) {
-			logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": salt not set");
+			logprintf(LOG_LEVEL_ERROR, "%s: salt not set", __FUNCTION__);
 			goto error;
 		}
 		rounds = buffer_get_int(kdf);
@@ -534,7 +534,7 @@
 		// TODO: error check
 		if (bcrypt_pbkdf(passphrase, strlen(passphrase), salt, slen,
 		    key, keylen + ivlen, rounds) < 0) {
-			logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": bcrypt_pbkdf failed");
+			logprintf(LOG_LEVEL_ERROR, "%s: bcrypt_pbkdf failed", __FUNCTION__);
 			goto error;
 		}
 	}
@@ -551,7 +551,7 @@
 	buffer_consume(copy_consumed, len);
 
 	if (buffer_remain_len(copy_consumed) != 0) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": key blob has trailing data (len = %u)",
+		logprintf(LOG_LEVEL_ERROR, "%s: key blob has trailing data (len = %u)", __FUNCTION__,
 			buffer_remain_len(copy_consumed));
 		goto error;
 	}
@@ -559,11 +559,11 @@
 	/* check bytes */
 	if (buffer_get_int_ret(&check1, b) < 0 ||
 	    buffer_get_int_ret(&check2, b) < 0) {
-		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": check bytes missing");
+		logprintf(LOG_LEVEL_ERROR, "%s: check bytes missing", __FUNCTION__);
 		goto error;
 	}
 	if (check1 != check2) {
-		logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": decrypt failed: 0x%08x != 0x%08x",
+		logprintf(LOG_LEVEL_VERBOSE, "%s: decrypt failed: 0x%08x != 0x%08x", __FUNCTION__,
 			check1, check2);
 		goto error;
 	}
@@ -579,7 +579,7 @@
 	while (buffer_remain_len(b)) {
 		if (buffer_get_char_ret(&pad, b) == -1 ||
 		    pad != (++i & 0xff)) {
-			logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": bad padding");
+			logprintf(LOG_LEVEL_ERROR, "%s: bad padding", __FUNCTION__);
 			key_free(keyfmt);
 			keyfmt = NULL;
 			goto error;

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2019-04-01 12:44:34 UTC (rev 7535)
+++ trunk/ttssh2/ttxssh/ssh.c	2019-04-01 12:45:02 UTC (rev 7536)
@@ -83,6 +83,10 @@
 //
 #define NonNull(msg) ((msg)?(msg):"(null)")
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 typedef enum {
 	GetPayloadError = 0,
 	GetPayloadOK = 1,
@@ -181,7 +185,7 @@
 // channel function
 //
 static Channel_t *ssh2_channel_new(unsigned int window, unsigned int maxpack,
-                                   enum confirm_type type, int local_num)
+                                   enum channel_type type, int local_num)
 {
 	int i, found;
 	Channel_t *c;
@@ -3808,7 +3812,7 @@
 		auth_data_ptr = outmsg + 8 + protocol_len;
 		for (i = 0; i < auth_data_len; i++) {
 			_snprintf_s(auth_data_ptr + i * 2,
-			            outmsg_len - (auth_data_ptr - outmsg) - i * 2,
+			            outmsg_len - ((UINT_PTR)auth_data_ptr - (UINT_PTR)outmsg) - i * 2,
 			            _TRUNCATE, "%.2x", auth_data[i]);
 		}
 		set_uint32(outmsg + 8 + protocol_len + data_len, screen_num);
@@ -5833,7 +5837,7 @@
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
 	if (hostkey->type != pvar->hostkey_type) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
-		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", __FUNCTION__,
+		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", /*__FUNCTION__*/"handle_SSH2_dh_kex_reply",
 		            get_ssh_keytype_name(pvar->hostkey_type), get_ssh_keytype_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -5976,7 +5980,7 @@
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
 	if (hostkey->type != pvar->hostkey_type) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
-		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", __FUNCTION__,
+		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", /*__FUNCTION__*/"handle_SSH2_dh_gex_reply",
 		            get_ssh_keytype_name(pvar->hostkey_type), get_ssh_keytype_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -6125,7 +6129,7 @@
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
 	if (hostkey->type != pvar->hostkey_type) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
-		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", __FUNCTION__,
+		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", /*__FUNCTION__*/"handle_SSH2_ecdh_kex_reply",
 		            get_ssh_keytype_name(pvar->hostkey_type), get_ssh_keytype_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;


Ttssh2-commit メーリングリストの案内
Back to archive index