+2018-10-24 Keith Marshall <keith@users.osdn.me>
+
+ Make <wincon.h> header effectively self-contained.
+
+ * include/wincon.h [_WIN32_WINNT < 0x0600]: Include <windef.h>...
+ [_WIN32_WINNT >= 0x0600]: ...but, Vista and later need <wingdi.h>
+ [__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 <texasgaidheal@users.osdn.me>
Improve WinXP/Vista console I/O support.
#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, <wincon.h> is dependent on the core set
+ * of Windows' custom type definitions; prior to Vista, it suffices to...
+ */
+# include <windef.h>
+#else
+/* ...but Vista and later introduce additional dependencies on <wingdi.h>;
+ * this will indirectly include <windef.h> anyway, so it suffices to...
+ */
+# include <wingdi.h>
#endif
+_BEGIN_C_DECLS
+
#define FOREGROUND_BLUE 1
#define FOREGROUND_GREEN 2
#define FOREGROUND_RED 4
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
#endif
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
+
#endif