From e3de78582f064f0446f3229d1ddcbaaf2974f479 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Tue, 19 Apr 2005 12:29:25 +0000 Subject: [PATCH] Transform the name of the temp dir on Windows with GetLongPathName. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9833 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 4 ++++ src/support/package.C.in | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 80bb593a60..b48b5791fc 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,7 @@ +2005-04-19 Angus Leeming + + * package.C.in (get_temp_dir): call GetLongPathName on Windows. + 2005-04-19 Angus Leeming * pch.h: protect unix-specific headers from breaking compilation diff --git a/src/support/package.C.in b/src/support/package.C.in index 9a9a2afc7b..6082df98f0 100644 --- a/src/support/package.C.in +++ b/src/support/package.C.in @@ -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[PATH_MAX + 1]; GetTempPath(PATH_MAX, path); + GetLongPathName(path, path, PATH_MAX + 1); return os::internal_path(path); #else // Posix-like. return "/tmp"; -- 2.39.2