]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_win32.h
prepare Qt 5.6 builds
[lyx.git] / src / support / os_win32.h
index 7bb2800737009d2e177a1969e9c9300aba0bae6b..618c5315efb10b0a786fa5ff6e399a16e9c83b3a 100644 (file)
 #endif
 
 /* The GetLongPathNameA function declaration in
- * winbase.h under MinGW or Cygwin is protected
- * by the WINVER macro which is defined in windef.h
+ * <winbase.h> is protected by the WINVER macro which is
+ * defined to a default value in <windef.h> 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 <shlobj.h> for __W32API_VERSION >= 3.2
+ * where it is protected by _WIN32_IE, also defined to a default value
+ * in <windef.h> under MinGW and Cygwin.
+ * It is missing in earlier versions of the MinGW w32api headers.
+ *
+ * We need to #include <windows.h> 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
+# if defined(WINVER) && WINVER < 0x0500
 #  error WINVER must be >= 0x0500
 # endif
+# define WINVER 0x0500
+# define _WIN32_IE 0x0500
 #endif
 
-#include <windef.h>
+#include <windows.h>
+#include <tchar.h>
+#include <psapi.h>
 
 
 namespace lyx {
@@ -67,7 +76,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: