Skip to content

Commit

Permalink
layer for unicode をライブラリに分離
Browse files Browse the repository at this point in the history
- Windows 9xをサポートするためのパートをライブラリとして切り出し
  - MSUL(unicows.lib)と同様に、ライブラリをリンクするだけで 9x をサポート
  - Tera Term のソース(layer for unicode 以外の部分)では 9x を気にする必要がなくなった
- vs2005 のプロジェクトを調整
- CMakeLists.txt 調整
  - VS2005 を使用しないと 95での起動はできない
  - しかしVS2005をサポートしている cmake のバージョンが古い

git-svn-id: https://svn.osdn.net/svnroot/ttssh2/trunk@9325 f5f01b69-1e22-0410-acbf-894ab4bd6246
  • Loading branch information
zmatsuo committed Jun 29, 2021
1 parent b7a4aef commit 5741bbb
Show file tree
Hide file tree
Showing 42 changed files with 1,513 additions and 173 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ charset = cp932
indent_style = tab
indent_size = 4

[*.asm]
end_of_line = crlf
charset = utf8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[{CMakeLists.txt,*.cmake}]
end_of_line = crlf
charset = utf-8-bom
Expand Down
5 changes: 5 additions & 0 deletions TTXKanjiMenu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXAdditionalTitle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXAlwaysOnTop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
common_static
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXCallSysMenu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXFixedWinSize/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXResizeMenu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXResizeWin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/TTXShowCommandLine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
10 changes: 10 additions & 0 deletions TTXSamples/TTXttyrec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
TTXttyplay
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
TTXttyplay
Expand Down Expand Up @@ -58,6 +63,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
TTXttyrec
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
TTXttyrec
Expand Down
5 changes: 5 additions & 0 deletions TTXSamples/ttxtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ add_library(
)

if(SUPPORT_OLD_WINDOWS)
target_link_libraries(
${PACKAGE_NAME}
PRIVATE
layer_for_unicode
)
if(MSVC)
target_sources(
${PACKAGE_NAME}
Expand Down
20 changes: 20 additions & 0 deletions buildtools/nasm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# cmake -P nasm.cmake

set(NASM_BASE "nasm-2.15.05")
set(NASM_ZIP "${NASM_BASE}-win32.zip")
set(NASM_URL "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win32/${NASM_ZIP}")
set(NASM_HASH "258c7d1076e435511cf2fdf94e2281eadbdb9e3003fd57f356f446e2bce3119e")
file(MAKE_DIRECTORY "download/nasm")
file(DOWNLOAD
${NASM_URL}
download/nasm/${NASM_ZIP}
EXPECTED_HASH SHA256=${NASM_HASH}
SHOW_PROGRESS
)
if(EXISTS "nasm")
file(REMOVE_RECURSE "nasm")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xvf download/nasm/${NASM_ZIP}
)
file(RENAME "${NASM_BASE}" "nasm")
21 changes: 16 additions & 5 deletions teraterm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,20 @@ set_target_properties(
common_static
PROPERTIES FOLDER teraterm)

if(SUPPORT_OLD_WINDOWS AND MINGW)
add_subdirectory(libmingw)
set_target_properties(
mingw_msvcrt
PROPERTIES FOLDER teraterm)
if(SUPPORT_OLD_WINDOWS)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_subdirectory(common/layer_for_unicode)
set_target_properties(
layer_for_unicode
PROPERTIES FOLDER teraterm)
endif()

if(MINGW)
add_subdirectory(libmingw)
set_target_properties(
mingw_msvcrt
PROPERTIES FOLDER teraterm)
endif(MINGW)
endif()


3 changes: 1 addition & 2 deletions teraterm/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ add_library(
getcontent.h
i18n.h
i18n_static.c
layer_for_unicode_crt.h
layer_for_unicode_crt.cpp
tipwin.cpp
tipwin.h
tmfc.cpp
Expand All @@ -51,5 +49,6 @@ target_include_directories(
target_link_libraries(
${PACKAGE_NAME}
PUBLIC
#
setupapi
)
2 changes: 1 addition & 1 deletion teraterm/common/common_static.v16.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 2 additions & 3 deletions teraterm/common/fileread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#include "codeconv.h"
#include "ttlib.h"
#include "layer_for_unicode_crt.h"

#include "fileread.h"

Expand Down Expand Up @@ -100,7 +99,7 @@ static void *LoadRawFile(FILE *fp, size_t *_len)
uint8_t *LoadFileBinary(const wchar_t *FileName, size_t *_len)
{
FILE *fp;
__wfopen_s(&fp, FileName, L"rb");
_wfopen_s(&fp, FileName, L"rb");
if (fp == NULL) {
return NULL;
}
Expand Down Expand Up @@ -254,7 +253,7 @@ wchar_t *LoadFileWW(const wchar_t *FileName, size_t *_len)
*_len = 0;
}
FILE *fp;
__wfopen_s(&fp, FileName, L"rb");
_wfopen_s(&fp, FileName, L"rb");
if (fp == NULL) {
return NULL;
}
Expand Down
Loading

0 comments on commit 5741bbb

Please sign in to comment.