[Ttssh2-commit] [7249] clangでコンパイルできるよう調整

scmno****@osdn***** scmno****@osdn*****
2018年 9月 22日 (土) 02:37:03 JST


Revision: 7249
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7249
Author:   zmatsuo
Date:     2018-09-22 02:37:03 +0900 (Sat, 22 Sep 2018)
Log Message:
-----------
clangでコンパイルできるよう調整

Modified Paths:
--------------
    branches/cmake/CMakeLists.txt
    branches/cmake/TTProxy/CMakeLists.txt
    branches/cmake/TTProxy/ProxyWSockHook.h
    branches/cmake/teraterm/teraterm/filesys.cpp
    branches/cmake/teraterm/teraterm/vtwin.cpp
    branches/cmake/teraterm/teraterm/vtwin.h

Added Paths:
-----------
    branches/cmake/00memo.md

-------------- next part --------------
Added: branches/cmake/00memo.md
===================================================================
--- branches/cmake/00memo.md	                        (rev 0)
+++ branches/cmake/00memo.md	2018-09-21 17:37:03 UTC (rev 7249)
@@ -0,0 +1,5 @@
+
+# cygwin
+cmake -DCMAKE_FIND_ROOT_PATH=/usr/i686-w64-mingw32 -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ -DCMAKE_RC_COMPILER=i686-w64-mingw32-windres .. -G "Unix Makefiles"
+
+cmake -DCMAKE_FIND_ROOT_PATH=/usr/i686-w64-mingw32 -DCMAKE_C_COMPILER=i686-w64-mingw32-clang -DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ -DCMAKE_RC_COMPILER=i686-w64-mingw32-windres .. -G "Unix Makefiles"

Modified: branches/cmake/CMakeLists.txt
===================================================================
--- branches/cmake/CMakeLists.txt	2018-09-19 23:18:40 UTC (rev 7248)
+++ branches/cmake/CMakeLists.txt	2018-09-21 17:37:03 UTC (rev 7249)
@@ -24,6 +24,14 @@
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
   endif()
 elseif(MINGW)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -static -ffunction-sections -fdata-sections")
+  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++")
+  endif()
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -s -Wl,--gc-sections")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -s -Wl,--gc-sections")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__MINGW_USE_VC2005_COMPAT=1")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__MINGW_USE_VC2005_COMPAT=1")
 #  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lmsvcr80")

Modified: branches/cmake/TTProxy/CMakeLists.txt
===================================================================
--- branches/cmake/TTProxy/CMakeLists.txt	2018-09-19 23:18:40 UTC (rev 7248)
+++ branches/cmake/TTProxy/CMakeLists.txt	2018-09-21 17:37:03 UTC (rev 7249)
@@ -9,6 +9,13 @@
   ../teraterm/common/ttlib.h
   ../teraterm/common/i18n.c
   ../teraterm/common/i18n.h
+  ../teraterm/teraterm/ttdialog.h
+  ../teraterm/teraterm/ttfileio.h
+  ../teraterm/common/ttplugin.h
+  ../teraterm/teraterm/ttsetup.h
+  ../teraterm/common/tttypes.h
+  ../teraterm/common/tt-version.h
+  ../teraterm/teraterm/ttwsk.h
   )
 source_group(
   "common"

Modified: branches/cmake/TTProxy/ProxyWSockHook.h
===================================================================
--- branches/cmake/TTProxy/ProxyWSockHook.h	2018-09-19 23:18:40 UTC (rev 7248)
+++ branches/cmake/TTProxy/ProxyWSockHook.h	2018-09-21 17:37:03 UTC (rev 7249)
@@ -1389,9 +1389,9 @@
         static const char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
         char buf[1024];
         int status_code;
-        if (sendToSocketFormat(s, strchr(realhost,':')?"CONNECT [%s]:%d HTTP/1.1\r\n":"CONNECT %s:%d HTTP/1.1\r\n", realhost, realport) == SOCKET_ERROR)
+        if (sendToSocketFormat(s, strchr(realhost,':')?"CONNECT [%s]:%d HTTP/1.1\r\n":"CONNECT %s:%d HTTP/1.1\r\n", (const char *)realhost, realport) == SOCKET_ERROR)
             return SOCKET_ERROR;
-        if (sendToSocketFormat(s, strchr(realhost,':')?"Host: [%s]:%d\r\n":"Host: %s:%d\r\n", realhost, realport) == SOCKET_ERROR)
+        if (sendToSocketFormat(s, strchr(realhost,':')?"Host: [%s]:%d\r\n":"Host: %s:%d\r\n", (const char *)realhost, realport) == SOCKET_ERROR)
             return SOCKET_ERROR;
         if (proxy.user != NULL) {
             int userlen = strlen(proxy.user);
@@ -1732,15 +1732,15 @@
         while (!err) {
             switch (wait_for_prompt(s, prompt_table, countof(prompt_table), 10)) {
             case 0: /* Hostname prompt */
-                if (sendToSocketFormat(s, strchr(realhost,':')?"[%s]:%d\n":"%s:%d\n", realhost, realport) == SOCKET_ERROR)
+                if (sendToSocketFormat(s, strchr(realhost,':')?"[%s]:%d\n":"%s:%d\n", (const char *)realhost, realport) == SOCKET_ERROR)
                     return SOCKET_ERROR;
                 break;
             case 1: /* Username prompt */
-                if (sendToSocketFormat(s, "%s\n", proxy.user) == SOCKET_ERROR)
+                if (sendToSocketFormat(s, "%s\n", (const char *)proxy.user) == SOCKET_ERROR)
                     return SOCKET_ERROR;
                 break;
             case 2: /* Password prompt */
-                if (sendToSocketFormat(s, "%s\n", proxy.pass) == SOCKET_ERROR)
+                if (sendToSocketFormat(s, "%s\n", (const char *)proxy.pass) == SOCKET_ERROR)
                     return SOCKET_ERROR;
                 break;
             case 3: /* Established message */

Modified: branches/cmake/teraterm/teraterm/filesys.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/filesys.cpp	2018-09-19 23:18:40 UTC (rev 7248)
+++ branches/cmake/teraterm/teraterm/filesys.cpp	2018-09-21 17:37:03 UTC (rev 7249)
@@ -270,7 +270,7 @@
 	{
 		CloseFileSync(*fv);
 		//if ((*fv)->FileOpen) _lclose((*fv)->FileHandle);
-		if ((*fv)->FnStrMemHandle>0)
+		if ((*fv)->FnStrMemHandle != 0)
 		{
 			GlobalUnlock((*fv)->FnStrMemHandle);
 			GlobalFree((*fv)->FnStrMemHandle);

Modified: branches/cmake/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/vtwin.cpp	2018-09-19 23:18:40 UTC (rev 7248)
+++ branches/cmake/teraterm/teraterm/vtwin.cpp	2018-09-21 17:37:03 UTC (rev 7249)
@@ -392,7 +392,7 @@
 // (2007.9.30 yutaka)
 //
 // \x97\xE1\x8AO\x83R\x81[\x83h\x82𕶎\x9A\x97\xF1\x82֕ϊ\xB7\x82\xB7\x82\xE9
-static const char *GetExceptionString(int exception)
+static const char *GetExceptionString(DWORD exception)
 {
 #define EXCEPTION(x) case EXCEPTION_##x: return (#x);
 	static char buf[16];
@@ -4516,7 +4516,7 @@
 	CAddSettingPropSheetDlg CAddSetting(hInst, "Tera Term: Additional settings", HVTWin);
 	ret = CAddSetting.DoModal();
 	switch (ret) {
-		case -1:
+		case (DWORD)-1:
 		case IDABORT:
 			ret = GetLastError();
 			break;
@@ -6338,8 +6338,7 @@
 		break;
 	case WM_COMMAND:
 	{
-		WORD wID = GET_WM_COMMAND_ID(wp, lp);
-		const WORD wCMD = GET_WM_COMMAND_CMD(wp, lp);
+		const WORD wID = GET_WM_COMMAND_ID(wp, lp);
 		switch (wID) {
 		case ID_FILE_NEWCONNECTION: OnFileNewConnection(); break;
 		case ID_FILE_DUPLICATESESSION: OnDuplicateSession(); break;

Modified: branches/cmake/teraterm/teraterm/vtwin.h
===================================================================
--- branches/cmake/teraterm/teraterm/vtwin.h	2018-09-19 23:18:40 UTC (rev 7248)
+++ branches/cmake/teraterm/teraterm/vtwin.h	2018-09-21 17:37:03 UTC (rev 7249)
@@ -56,8 +56,6 @@
   char **DropLists;
   int DropListCount;
   void DropListFree();
-  bool DropWithLeftbutton;
-  bool DropWithRightbutton;
 
 protected:
 



Ttssh2-commit メーリングリストの案内