Skip to content

Commit 3e96d6a

Browse files
committed
Make TVision build on Windows XP and preserve default behavior of Windows Vista.
1 parent df6424f commit 3e96d6a

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

source/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ if (TV_USE_STATIC_RTL) # Implies MSVC
5959
endif()
6060

6161
if (WIN32)
62+
# Windows XP is the minimum supported version. Default is Windows Vista.
63+
set(TV_WIN_VER "0x600" CACHE STRING "Turbo Vision: Windows version")
6264
target_compile_definitions(${PROJECT_NAME} PUBLIC
6365
_CRT_NONSTDC_NO_WARNINGS
6466
_CRT_SECURE_NO_WARNINGS
6567
)
6668
target_compile_definitions(${PROJECT_NAME} PRIVATE
67-
# Windows Vista is the minimum supported version.
68-
_WIN32_WINNT=0x0600
69+
_WIN32_WINNT=${TV_WIN_VER}
6970
)
7071
endif()
7172

source/platform/win32con.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Win32ConsoleAdapter &Win32ConsoleAdapter::create() noexcept
8181
// "A monospace bitmap font has all of these low-order bits clear".
8282
return !(family & (TMPF_FIXED_PITCH | TMPF_VECTOR | TMPF_TRUETYPE | TMPF_DEVICE));
8383
};
84+
#if _WIN32_WINNT > 0x600
8485
if ( GetCurrentConsoleFontEx(con.out(), FALSE, &fontInfo)
8586
&& isBitmap(fontInfo.FontFamily) )
8687
{
@@ -101,6 +102,7 @@ Win32ConsoleAdapter &Win32ConsoleAdapter::create() noexcept
101102
break;
102103
}
103104
}
105+
#endif
104106
}
105107
WinWidth::reset();
106108
auto &display = *new Win32Display(con, supportsVT);

source/tvision/textview.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,9 @@ otstream::otstream( TTerminal *tt ) :
248248
ostream(tt)
249249
{
250250
}
251+
252+
#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x600)
253+
#if !defined(__GNUC__) || (defined(__GNUC__) && (__GNUC__ <= 8))
254+
#include "ttprvlns.cpp"
255+
#endif
256+
#endif

source/tvision/ttimerqu.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ static TTimePoint systemTimeMs()
88
return THardwareInfo::getTickCount()*55;
99
#elif defined( __BORLANDC__ )
1010
return GetTickCount();
11+
#elif defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x600)
12+
return GetTickCount();
1113
#else
1214
return GetTickCount64();
1315
#endif

0 commit comments

Comments
 (0)