From 0efa612573506cdfb05a66a9c57c8f840adf416c Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Wed, 24 Oct 2018 21:41:19 +0100 Subject: [PATCH] Make header effectively self-contained. --- w32api/ChangeLog | 10 ++++++++++ w32api/include/wincon.h | 21 ++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/w32api/ChangeLog b/w32api/ChangeLog index 65f4301..470878f 100644 --- a/w32api/ChangeLog +++ b/w32api/ChangeLog @@ -1,3 +1,13 @@ +2018-10-24 Keith Marshall + + Make header effectively self-contained. + + * include/wincon.h [_WIN32_WINNT < 0x0600]: Include ... + [_WIN32_WINNT >= 0x0600]: ...but, Vista and later need + [__GNUC__ >= 3]: Remove condition; used only in association with... + (#pragma GCC system_header): ...this, it is redundant in this context. + [_BEGIN_C_DECLS, _END_C_DECLS]: Use them as appropriate. + 2018-10-24 David Gressett Improve WinXP/Vista console I/O support. diff --git a/w32api/include/wincon.h b/w32api/include/wincon.h index f49d994..5fbe429 100644 --- a/w32api/include/wincon.h +++ b/w32api/include/wincon.h @@ -1,13 +1,21 @@ #ifndef _WINCON_H #define _WINCON_H -#if __GNUC__ >= 3 #pragma GCC system_header -#endif -#ifdef __cplusplus -extern "C" { +#if _WIN32_WINNT < 0x0600 +/* For effective self-containment, is dependent on the core set + * of Windows' custom type definitions; prior to Vista, it suffices to... + */ +# include +#else +/* ...but Vista and later introduce additional dependencies on ; + * this will indirectly include anyway, so it suffices to... + */ +# include #endif +_BEGIN_C_DECLS + #define FOREGROUND_BLUE 1 #define FOREGROUND_GREEN 2 #define FOREGROUND_RED 4 @@ -355,7 +363,6 @@ BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,PDWORD); #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA #endif -#ifdef __cplusplus -} -#endif +_END_C_DECLS + #endif -- 2.11.0