diff --git a/windows/utf16.cpp b/windows/utf16.cpp index 131759e9..143bad24 100644 --- a/windows/utf16.cpp +++ b/windows/utf16.cpp @@ -1,6 +1,13 @@ // 21 april 2016 #include "uipriv_windows.hpp" +// sanity check - make sure wchar_t is 16 bits (the assumption on windows) +// (MinGW-w64 gcc does seem to define a 16bit wchar_t, but you never know. Other windows gcc ports might not) +#if WCHAR_MAX > 0xFFFF + #error wchar_t larger than 16bit +#endif + + // see http://stackoverflow.com/a/29556509/3408572 WCHAR *toUTF16(const char *str) diff --git a/windows/winapi.hpp b/windows/winapi.hpp index 1b2ab000..909aa56b 100644 --- a/windows/winapi.hpp +++ b/windows/winapi.hpp @@ -23,6 +23,13 @@ #define _WIN32_IE 0x0700 #define NTDDI_VERSION 0x06000000 +// the msys2 header has an unverified IDWriteTypography definition. +// Would be good to get it verified and fixed in msys2, but in the meantime, +// this define lets us compile.... +#if !defined(_MSC_VER) +#define __MINGW_USE_BROKEN_INTERFACE +#endif + #include // Microsoft's resource compiler will segfault if we feed it headers it was not designed to handle