[Ttssh2-commit] [9230] _WIN32_WINNTをコンパイルオプションで指定

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 5月 4日 (火) 00:04:42 JST


Revision: 9230
          https://osdn.net/projects/ttssh2/scm/svn/commits/9230
Author:   zmatsuo
Date:     2021-05-04 00:04:42 +0900 (Tue, 04 May 2021)
Log Message:
-----------
_WIN32_WINNTをコンパイルオプションで指定

- Tera Term は _WIN32_WINNT >= 0x0501 でビルドすることが前提となっている
  - 0x0501=_WIN32_WINNT_WINXP
    - Windows XP
    - Windows Server 2003
  - Visual Studio 2005 のプロジェクトファイルに /D_WIN32_WINNT=0x0501 追加済み(r9191)
- teraterm_conf.h を削除
  - WIN32_WINNT をコンパイルオプションで指定するため r7554 で追加した
  - コマンドラインで明示的に指定するようになったた不要となった
    - SDK 7.0 では _WIN32_WINNT が自動で設定されない
    - SDK 7.0 より新しいSDKでは、特に指定されていない場合、自動で設定される
      - SDKのバージョンによって自動で設定される_WIN32_WINNT の値は異なっている
      - SDK 7.1 の場合 0x0601
      - SDK 10.0.18362.0 の場合 0x0A00
      - sdkddkver.h 内で設定される
        - MinGWの場合は _mingw.h
- Visual Studio 2005 では次のSDKでビルドできることを確認済み
  - SDK 7.0
  - SDK 7.1
- Tera Term は Visual Studio 2005 以上をサポート
  - MSC_VER >= 1400

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/9191
    https://osdn.net/projects/ttssh2/scm/svn/commits/7554

Modified Paths:
--------------
    trunk/.gitignore
    trunk/CMakeLists.txt
    trunk/teraterm/common/ttlib.c
    trunk/teraterm/common/ttlib_static.c
    trunk/teraterm/teraterm/addsetting.cpp
    trunk/teraterm/teraterm/broadcast.cpp
    trunk/teraterm/teraterm/ftdlg.cpp
    trunk/teraterm/teraterm/ftdlg_lite.cpp
    trunk/teraterm/teraterm/teraterm.cpp
    trunk/teraterm/teraterm/ttplug.c
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/winjump.c
    trunk/teraterm/ttpcmn/ttcmn.c
    trunk/teraterm/ttpcmn/ttcmn_notify.cpp
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/ttssh2/ttxssh/ttxssh.c

Removed Paths:
-------------
    trunk/teraterm/common/teraterm_conf.h

-------------- next part --------------
Modified: trunk/.gitignore
===================================================================
--- trunk/.gitignore	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/.gitignore	2021-05-03 15:04:42 UTC (rev 9230)
@@ -9,3 +9,7 @@
 /GTAGS
 /GPATH
 /GRTAGS
+*.ncb
+*.suo
+*.user
+*.map

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/CMakeLists.txt	2021-05-03 15:04:42 UTC (rev 9230)
@@ -19,46 +19,51 @@
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 
-# _WIN32_WINNT_WIN10 0x0a00
-set(_WIN32_WINNT "0x0a00")
+#set(_WIN32_WINNT "0x0a00") # 0x0a00=_WIN32_WINNT_WIN10
+#set(_WIN32_WINNT "0x0501") # Tera Term がビルドできる最小値
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" OR ${CMAKE_GENERATOR} MATCHES "Visual Studio 9 2008")
+  set(_WIN32_WINNT "0x0501")
+endif()
+
 if(MSVC)
   # https://www.leeholmes.com/blog/2017/02/27/differences-between-visual-studio-2012-2013-and-2015/
-  if(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" OR ${CMAKE_GENERATOR} MATCHES "Visual Studio 9 2008")
-    set(_WIN32_WINNT "0x0501")
+  if(_WIN32_WINNT)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_WIN32_WINNT=${_WIN32_WINNT}")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=${_WIN32_WINNT}")
   endif()
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=${_WIN32_WINNT}")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_WIN32_WINNT=${_WIN32_WINNT}")
   string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
   string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
   string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
   string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
   if (MORE_WARNING)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
     if(${MSVC_VERSION} GREATER_EQUAL 1910) # Visual Studio 2017以上の時
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /analyze")
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /analyze")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /analyze")
     endif()
   else()
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_DEPRECATE")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_DEPRECATE")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_DEPRECATE")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
   endif()
+  set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GF /Gy")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GF /Gy")
-  set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GF /Gy")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
   if(${MSVC_VERSION} GREATER_EQUAL 1910)
     # Visual Studio 2017以上の時
+    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /ZI")
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /ZI")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
   endif()
 elseif(MINGW)
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
+  if(_WIN32_WINNT)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=${_WIN32_WINNT}")
+  endif()
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__USE_MINGW_ANSI_STDIO=0")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO=0")
   set(CMAKE_C_CXX_WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare")

Deleted: trunk/teraterm/common/teraterm_conf.h
===================================================================
--- trunk/teraterm/common/teraterm_conf.h	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/common/teraterm_conf.h	2021-05-03 15:04:42 UTC (rev 9230)
@@ -1,92 +0,0 @@
-/*
- * (C) 2019- TeraTerm Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* teraterm_conf.h */
-
-/*
- * windows.h \x82Ȃǂ\xF0 include \x82\xB7\x82\xE9\x91O\x82\xC9 include \x82\xB7\x82\xE9\x83t\x83@\x83C\x83\x8B
- * \x95K\x97v\x82Ȓ\xE8\x8B`\x82\xF0\x8Ds\x82\xA4
- */
-
-#pragma once
-
-/* \x8Eg\x97p\x82\xB7\x82\xE9 Windows SDK \x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x8Ew\x92肷\x82\xE9
- *		\x81EWindows SDK(header)\x93\xE0\x82̊e\x8E\xED\x92\xE8\x8B`\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x8Ew\x92肷\x82\xE9
- *		\x81ETera Term \x93\xE0\x82Ŏg\x97p\x82\xB5\x82Ă\xA2\x82\xE9\x8Ae\x8E\xED\x92\xE8\x8B`\x82\xAASDK\x82ɂȂ\xAF\x82\xEA\x82\xCE
- *		  compat_win.h \x82Œ\xE8\x8B`\x82\xB3\x82\xEA\x82\xE9
- */
-#if !defined(_WIN32_WINNT)
-//#define	_WIN32_WINNT 0x0a00		// _WINNT_WIN10	Windows 10
-#define		_WIN32_WINNT 0x0501		// _WINNT_WINXP	Windows XP \x81\xAAbuild ok
-//#define	_WIN32_WINNT 0x0500		// _WINNT_WIN2K	Windows 2000 \x81\xABbuild ng
-//#define	_WIN32_WINNT 0x0400		// _WINNT_NT4	Windows NT 4.0(95)
-#endif
-
-/*
- * VS2005\x82\xF0\x8Eg\x82\xC1\x82Ă\xA2\x82\xE9\x8Fꍇ\x81A
- * _WIN32_WINNT \x82\xAA 0x0501 \x82łȂ\xAF\x82\xEA\x82΃G\x83\x89\x81[\x82\xF0\x8Fo\x82\xB7
- */
-#if _MSC_VER == 1400  // VS2005
-#if _WIN32_WINNT != 0x0501
-#error check _WIN32_WINNT
-#endif
-#endif
-
-/*
- *	_WIN32_WINNT\x82\xA9\x82玟\x82\xCCdefine\x82\xF0\x93K\x90؂ɐݒ肷\x82\xE9
- *		NTDDI_VERSION
- *		WINVER
- *		_WIN32_IE
- *	\x82\xB1\x82\xCCdefine\x82͒\xE8\x8B`\x82\xB3\x82\xEA\x82Ȃ\xA2
- *		_WIN32_WINDOWS
- */
-//#include <sdkddkver.h>
-
-
-/*
- *	SDK 7.0
- *		Windows Server 2003 R2 Platform SDK
- *		(Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1)
- *	SDK 7.1
- *		Microsoft Windows SDK for Windows 7 and .NET Framework 4
- */
-/*
- * SDK 7.0 \x91΍\xF4
- *	7.0 \x82\xCD 7.1 \x88ȍ~\x82Ǝ\x9F\x82̈Ⴂ\x82\xAA\x82\xA0\x82\xE9
- *	- _WIN32_WINNT \x82\xAA\x92\xE8\x8B`\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2\x8Fꍇ\x81A\x8E\xA9\x93\xAE\x82Őݒ肵\x82Ȃ\xA2
- *		_WIN32_IE\x82Ȃǂ\xE0\x8E\xA9\x93\xAE\x82Őݒ肳\x82\xEA\x82Ȃ\xA2
- *	- sdkddkver.h \x82\xAA\x91\xB6\x8D݂\xB5\x82Ȃ\xA2
- *		_WIN32_WINNT \x82\xA9\x82\xE7 _WIN32_IE \x82Ȃǂ\xF0\x93K\x90؂Ȓl\x82Ɏ\xA9\x93\xAE\x90ݒ肷\x82\xE9\x83w\x83b\x83_
- *		\x8E蓮\x82Őݒ肷\x82\xE9
- *	- WinSDKVer.h \x82\xAA\x91\xB6\x8D݂\xB5\x82Ȃ\xA2
- *		_WIN32_WINNT_MAXVER \x82\xAA\x82Ȃ\xA2
- *		\x8Eg\x97p\x82\xB5\x82Ă\xA2\x82\xE9 SDK \x82̃o\x81[\x83W\x83\x87\x83\x93\x82̃q\x83\x93\x83g\x82𓾂\xE7\x82\xEA\x82Ȃ\xA2
- */
-#if !defined(_WIN32_IE)
-#define _WIN32_IE       0x0600		// _WIN32_IE_XP
-#endif

Modified: trunk/teraterm/common/ttlib.c
===================================================================
--- trunk/teraterm/common/ttlib.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/common/ttlib.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -39,7 +39,6 @@
 #include <mbctype.h>	// for _ismbblead
 #include <assert.h>
 
-#include "teraterm_conf.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include "compat_win.h"

Modified: trunk/teraterm/common/ttlib_static.c
===================================================================
--- trunk/teraterm/common/ttlib_static.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/common/ttlib_static.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -38,7 +38,6 @@
 #include <ctype.h>
 #include <assert.h>
 
-#include "teraterm_conf.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include "compat_win.h"

Modified: trunk/teraterm/teraterm/addsetting.cpp
===================================================================
--- trunk/teraterm/teraterm/addsetting.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/addsetting.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -29,7 +29,6 @@
 /*
  * Additional settings dialog
  */
-#include "teraterm_conf.h"
 
 #include <stdio.h>
 #include <windows.h>

Modified: trunk/teraterm/teraterm/broadcast.cpp
===================================================================
--- trunk/teraterm/teraterm/broadcast.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/broadcast.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -28,7 +28,6 @@
 
 // vtwin\x82\xA9\x82番\x97\xA3
 
-#include "teraterm_conf.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include "ttcommon.h"

Modified: trunk/teraterm/teraterm/ftdlg.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/ftdlg.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -28,7 +28,6 @@
  */
 
 /* TERATERM.EXE, file transfer dialog box */
-#include "teraterm_conf.h"
 
 #include <stdio.h>
 #include <windows.h>

Modified: trunk/teraterm/teraterm/ftdlg_lite.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg_lite.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/ftdlg_lite.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -27,7 +27,6 @@
  */
 
 /* TERATERM.EXE, file transfer dialog box lite */
-#include "teraterm_conf.h"
 
 #include <stdio.h>
 #include <windows.h>

Modified: trunk/teraterm/teraterm/teraterm.cpp
===================================================================
--- trunk/teraterm/teraterm/teraterm.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/teraterm.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -29,11 +29,8 @@
 
 /* TERATERM.EXE, main */
 
-#include "teraterm_conf.h"
-
 #include <stdio.h>
 #include <crtdbg.h>
-#include <io.h>			// for access()
 #include <windows.h>
 #include <htmlhelp.h>
 #include "teraterm.h"

Modified: trunk/teraterm/teraterm/ttplug.c
===================================================================
--- trunk/teraterm/teraterm/ttplug.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/ttplug.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -130,9 +130,11 @@
 	}
 	// \x8C\xBE\x8C\xEA\x83t\x83@\x83C\x83\x8B\x82ɂ\xE6\x82郁\x83b\x83Z\x81[\x83W\x82̍\x91\x8Dۉ\xBB\x82\xF0\x8Ds\x82\xC1\x82Ă\xA2\x82邪\x81A\x82\xB1\x82̎\x9E\x93_\x82ł͐ݒ肪
 	// \x82܂\xBE\x93ǂݍ\x9E\x82܂\xEA\x82Ă\xA2\x82Ȃ\xA2\x88ׁA\x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x89p\x8C\xEA\x82̂܂܂ƂȂ\xE9\x81B\x97v\x8C\x9F\x93\xA2\x81B
-	static const TTMessageBoxInfoW info = {"Tera Term", "MSG_TT_ERROR", L"Tera Term: Error", "MSG_LOAD_EXT_ERROR",
-										   L"Cannot load extension %s (%d, %s)"};
-	TTMessageBoxW(NULL, &info, MB_OK | MB_ICONEXCLAMATION, ts.UILanguageFile, fileName, err, sub_message);
+	{
+		static const TTMessageBoxInfoW info = {"Tera Term", "MSG_TT_ERROR", L"Tera Term: Error", "MSG_LOAD_EXT_ERROR",
+			L"Cannot load extension %s (%d, %s)"};
+		TTMessageBoxW(NULL, &info, MB_OK | MB_ICONEXCLAMATION, ts.UILanguageFile, fileName, err, sub_message);
+	}
 }
 
 void PASCAL TTXInit(PTTSet ts_, PComVar cv_)

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/vtwin.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -30,7 +30,13 @@
 
 /* TERATERM.EXE, VT window */
 
-#include "teraterm_conf.h"
+// SDK7.0\x82̏ꍇ\x81AWIN32_IE\x82\xAA\x93K\x90؂ɒ\xE8\x8B`\x82\xB3\x82\xEA\x82Ȃ\xA2
+#if _MSC_VER == 1400	// VS2005\x82̏ꍇ\x82̂\xDD
+#if !defined(_WIN32_IE)
+#define	_WIN32_IE 0x0501
+#endif
+#endif
+
 #include "teraterm.h"
 #include "tttypes.h"
 
@@ -65,16 +71,17 @@
 #include <crtdbg.h>
 #include <string.h>
 #include <locale.h>
-
-#include <shlobj.h>
 #include <io.h>
 #include <errno.h>
 
+#include <shlobj.h>
+#include <windows.h>
 #include <windowsx.h>
 #include <imm.h>
 #include <dbt.h>
 #include <assert.h>
 #include <wchar.h>
+#include <htmlhelp.h>
 
 #include "tt_res.h"
 #include "vtwin.h"
@@ -83,7 +90,6 @@
 #include "sizetip.h"
 #include "dnddlg.h"
 #include "tekwin.h"
-#include <htmlhelp.h>
 #include "compat_win.h"
 #include "unicode_test.h"
 #if UNICODE_DEBUG

Modified: trunk/teraterm/teraterm/winjump.c
===================================================================
--- trunk/teraterm/teraterm/winjump.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/teraterm/winjump.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -46,8 +46,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "teraterm_conf.h"
-
 #include <windows.h>
 #include <assert.h>
 #include <stdio.h>
@@ -58,6 +56,13 @@
 #endif
 #include <stdlib.h>
 #include <crtdbg.h>
+#include <initguid.h>
+#if defined(__MINGW32__) || defined(_INC_SDKDDKVER)
+#define HAS_PROPKEY_H 1
+#endif
+#if defined(HAS_PROPKEY_H)
+#include <propkey.h>
+#endif
 
 #include "winjump.h"
 #include "teraterm.h"
@@ -81,15 +86,13 @@
 #define _REFPROPVARIANT_DEFINED
 typedef PROPVARIANT *REFPROPVARIANT;
 #endif
-/* MinGW doesn't define this yet: */
-#ifndef _PROPVARIANTINIT_DEFINED_
-#define _PROPVARIANTINIT_DEFINED_
-#define PropVariantInit(pvar) memset((pvar),0,sizeof(PROPVARIANT))
-#endif
 
 #ifndef __ICustomDestinationList_INTERFACE_DEFINED__
-#define __ICustomDestinationList_INTERFACE_DEFINED__
-// #if !(_MSC_VER >= 1600)  // VC2010(VC10.0) or later
+
+static const IID IID_ICustomDestinationList = {
+    0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}
+};
+
 typedef struct ICustomDestinationListVtbl {
     HRESULT ( __stdcall *QueryInterface ) (
         /* [in] ICustomDestinationList*/ void *This,
@@ -149,7 +152,11 @@
 #endif
 
 #ifndef __IObjectArray_INTERFACE_DEFINED__
-#define __IObjectArray_INTERFACE_DEFINED__
+
+static const IID IID_IObjectArray = {
+    0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}
+};
+
 typedef struct IObjectArrayVtbl
 {
     HRESULT ( __stdcall *QueryInterface )(
@@ -331,8 +338,11 @@
 #endif
 
 #ifndef __IPropertyStore_INTERFACE_DEFINED__
-#define __IPropertyStore_INTERFACE_DEFINED__
-// #if !(_MSC_VER >= 1500)  // VC2008(VC9.0) or later
+
+static const IID IID_IPropertyStore = {
+    0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}
+};
+
 typedef struct IPropertyStoreVtbl
 {
     HRESULT ( __stdcall *QueryInterface )(
@@ -375,7 +385,7 @@
 } IPropertyStore;
 #endif
 
-#if !defined(__MINGW32__)
+#if !defined(__MINGW32__) && !defined(__ShellCoreObjects_LIBRARY_DEFINED__)
 static const CLSID CLSID_DestinationList = {
     0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}
 };
@@ -392,23 +402,13 @@
     0x000214ee, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}
 };
 #endif
-#if (_WIN32_WINNT < 0x0601)		// _WIN32_WINNT_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}
-};
-static const IID IID_IPropertyStore = {
-    0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}
-};
-#endif
+
+#if !defined(HAS_PROPKEY_H)
 static const PROPERTYKEY PKEY_Title = {
     {0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}},
     0x00000002
 };
+#endif
 
 /* Type-checking macro to provide arguments for CoCreateInstance() etc.
  * The pointer arithmetic is a compile-time pointer type check that 'obj'

Modified: trunk/teraterm/ttpcmn/ttcmn.c
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/ttpcmn/ttcmn.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -27,10 +27,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x501
-#endif
-
 /* TTCMN.DLL, main */
 #include <direct.h>
 #include <string.h>

Modified: trunk/teraterm/ttpcmn/ttcmn_notify.cpp
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn_notify.cpp	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/ttpcmn/ttcmn_notify.cpp	2021-05-03 15:04:42 UTC (rev 9230)
@@ -28,7 +28,14 @@
 
 /* TTCMN.DLL, notify icon */
 
-#define _WIN32_IE 0x0600
+// SDK7.0\x82̏ꍇ\x81AWIN32_IE\x82\xAA\x93K\x90؂ɒ\xE8\x8B`\x82\xB3\x82\xEA\x82Ȃ\xA2
+#if _MSC_VER == 1400	// VS2005\x82̏ꍇ\x82̂\xDD
+#if !defined(_WIN32_IE)
+#define	_WIN32_IE 0x0501
+//#define _WIN32_IE 0x0600
+#endif
+#endif
+
 #include <string.h>
 #include <windows.h>
 #include <wchar.h>

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -29,7 +29,6 @@
 /* IPv6 modification is Copyright(C) 2000 Jun-ya Kato <kato****@win6*****> */
 
 /* TTDLG.DLL, dialog boxes */
-#include "teraterm_conf.h"
 #include "teraterm.h"
 #include <stdio.h>
 #include <string.h>

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2021-04-29 23:39:18 UTC (rev 9229)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2021-05-03 15:04:42 UTC (rev 9230)
@@ -33,7 +33,6 @@
    Tera Term by Takashi Teranishi (teran****@rikax*****)
 */
 
-#include "teraterm_conf.h"
 #include "ttxssh.h"
 #include "fwdui.h"
 #include "util.h"
@@ -2273,14 +2272,6 @@
 	SendMessage(GetDlgItem(dlg, IDC_PUTTY_VERSION), WM_SETTEXT, 0, (LPARAM)buf);
 }
 
-#if 0
-// WM_MOUSEWHEEL \x82\xCD winuser.h \x83w\x83b\x83_\x82Ő錾\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB7\x82\xAA\x81A#define _WIN32_WINNT 0x0400 \x82\xAA\x90錾\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2\x82ƔF\x8E\xAF\x82\xB3\x82\xEA\x82܂\xB9\x82\xF1\x81B
-#define WM_MOUSEWHEEL                   0x020A1
-#define WHEEL_DELTA                     120
-#define GET_WHEEL_DELTA_WPARAM(wParam)  ((short)HIWORD(wParam))
-#define GET_KEYSTATE_WPARAM(wParam)     (LOWORD(wParam))
-#endif
-
 static WNDPROC g_defAboutDlgEditWndProc;  // Edit Control\x82̃T\x83u\x83N\x83\x89\x83X\x89\xBB\x97p
 static int g_deltaSumAboutDlg = 0;        // \x83}\x83E\x83X\x83z\x83C\x81[\x83\x8B\x82\xCCDelta\x97ݐϗp
 


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