X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fos_win32.h;h=42016f7094eb7f33abe56afd7fb77b4fdcd8d5ee;hb=5608f6fdb67b86b4cf3d9215d24d7734239ad05a;hp=7bb2800737009d2e177a1969e9c9300aba0bae6b;hpb=73e1a6a470f6a01fe2ef8e9f4355f8e15abbfbe3;p=lyx.git diff --git a/src/support/os_win32.h b/src/support/os_win32.h index 7bb2800737..42016f7094 100644 --- a/src/support/os_win32.h +++ b/src/support/os_win32.h @@ -21,21 +21,33 @@ #endif /* The GetLongPathNameA function declaration in - * winbase.h under MinGW or Cygwin is protected - * by the WINVER macro which is defined in windef.h + * is protected by the WINVER macro which is + * defined to a default value in under MinGW and Cygwin. * - * We need to #include this file to make available the - * DWORD, HMODULE et al. typedefs, so check WINVER now. + * SHGFP_TYPE_CURRENT is defined in for __W32API_VERSION >= 3.2 + * where it is protected by _WIN32_IE, also defined to a default value + * in under MinGW and Cygwin. + * It is missing in earlier versions of the MinGW w32api headers. + * + * We need to #include now to make available the + * DWORD, HMODULE et al. typedefs, so first define WINVER, _WIN32_IE. * * Note: __CYGWIN__ can be defined here if building in _WIN32 mode. */ #if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__CYGWIN32__) -# if !defined(WINVER) || WINVER < 0x0500 -# error WINVER must be >= 0x0500 +# if defined(WINVER) +# if WINVER < 0x0500 +# error WINVER must be >= 0x0500 +# endif +# else +# define WINVER 0x0500 # endif +# define _WIN32_IE 0x0500 #endif -#include +#include +#include +#include namespace lyx { @@ -67,7 +79,7 @@ public: ~GetFolderPath(); /** Wrapper for SHGetFolderPathA, returning - * the path asscociated with @c id. + * the path asscociated with @c id in utf8 encoding. */ std::string const operator()(folder_id id) const; private: