From 2ad5f8cb4bc874d0a2d808427bf9cc1f84105a96 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 20 Apr 2005 08:56:07 +0000 Subject: [PATCH] (From Rob Bearman) Sync code needed by MSVC with changes in the main tree. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9837 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/Win32/package.C | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/development/Win32/package.C b/development/Win32/package.C index 76b8b09534..6ab4082b25 100644 --- a/development/Win32/package.C +++ b/development/Win32/package.C @@ -38,6 +38,24 @@ #endif #if defined (USE_WINDOWS_PACKAGING) + +/* + * MinGW's version of winver.h contains this comment: + * + * If you need Win32 API features newer the Win95 and WinNT then you must + * define WINVER before including windows.h or any other method of including + * the windef.h header. + * + * GetLongPathNameA requires WINVER == 0x0500. + * + * It doesn't matter if the Windows version is older than this because the + * function will compile but will fail at run time. See + * http://msdn.microsoft.com/library/en-us/mslu/winprog/microsoft_layer_for_unicode_apis_with_limited_support.asp + */ +# if defined(__MINGW32__) +# define WINVER 0x0500 +# endif + # include # include // SHGetFolderPath @@ -363,6 +381,7 @@ string const get_temp_dir() // Typical example: C:/TEMP/. char path[MAX_PATH + 1]; GetTempPath(MAX_PATH, path); + GetLongPathName(path, path, MAX_PATH + 1); return os::internal_path(path); #else // Posix-like. return "/tmp";