From 62ede2b601af8599da50830db1b26d6fd970cade Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 4 Jan 2016 00:46:54 -0500 Subject: [PATCH] Allow building Win32 console port with new color change code on Borland 5.5, potentially others with older wincon.h. --- curspriv.h | 4 ++++ win32/pdcscrn.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/curspriv.h b/curspriv.h index dcfd6479..462857b1 100644 --- a/curspriv.h +++ b/curspriv.h @@ -32,6 +32,10 @@ # define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */ #endif +#if defined(_WIN32) && !defined(__TURBOC__) && !defined(HAVE_INFOEX) +# define HAVE_INFOEX +#endif + /*----------------------------------------------------------------------*/ typedef struct /* structure for ripped off lines */ diff --git a/win32/pdcscrn.c b/win32/pdcscrn.c index bea01e1b..5ba5f94c 100644 --- a/win32/pdcscrn.c +++ b/win32/pdcscrn.c @@ -65,6 +65,22 @@ static struct WCHAR ConsoleTitle[0x100]; } console_info; +#ifndef HAVE_INFOEX +/* Console screen buffer information (extended version) */ +typedef struct _CONSOLE_SCREEN_BUFFER_INFOEX { + ULONG cbSize; + COORD dwSize; + COORD dwCursorPosition; + WORD wAttributes; + SMALL_RECT srWindow; + COORD dwMaximumWindowSize; + WORD wPopupAttributes; + BOOL bFullscreenSupported; + COLORREF ColorTable[16]; +} CONSOLE_SCREEN_BUFFER_INFOEX; +typedef CONSOLE_SCREEN_BUFFER_INFOEX *PCONSOLE_SCREEN_BUFFER_INFOEX; +#endif + static CONSOLE_SCREEN_BUFFER_INFO orig_scr; static LPTOP_LEVEL_EXCEPTION_FILTER xcpt_filter;