From: jacob Date: Tue, 9 Jan 2007 23:47:15 +0000 (+0000) Subject: MinGW needs an extra symbol _WIN32_IE defined to a particular value before X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/8f5f26d24e18e267dd56e8c0b7d856027f63e41c?hp=62ddb51e0424dd4bd1098b024f2427959aefc729 MinGW needs an extra symbol _WIN32_IE defined to a particular value before it'll let you see an identifier (SHGFP_TYPE_CURRENT) referenced since r7082. (Actually, you need a pretty recent w32api before it's there at all.) Morally, this should be defined for all toolchains, not just MinGW/Cygwin, but I'll leave that to people who have those toolchains. Also add some other comments on our use of this API (since it's a horrible one that I suspect will come back and haunt us...) git-svn-id: svn://svn.tartarus.org/sgt/putty@7087 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/Recipe b/Recipe index e256ccab..416acc9c 100644 --- a/Recipe +++ b/Recipe @@ -218,6 +218,13 @@ install-strip: CFLAGS += -DMACOSX !end +# Random symbols. +!begin cygwin vars +# _WIN32_IE is required to expose identifiers that only make sense on +# systems with IE5+ installed, such as some arguments to SHGetFolderPath(). +CFLAGS += -D_WIN32_IE=0x0500 +!end + # ------------------------------------------------------------ # Definitions of object groups. A group name, followed by an =, # followed by any number of objects or other already-defined group diff --git a/windows/winstore.c b/windows/winstore.c index c44a9ce0..0e7638f5 100644 --- a/windows/winstore.c +++ b/windows/winstore.c @@ -492,6 +492,12 @@ static HANDLE access_random_seed(int action) * versions of Windows. */ if (!tried_shgetfolderpath) { + /* This is likely only to bear fruit on systems with IE5+ + * installed, or WinMe/2K+. There is some faffing with + * SHFOLDER.DLL we could do to try to find an equivalent + * on older versions of Windows if we cared enough. + * However, the invocation below requires IE5+ anyway, + * so stuff that. */ shell32_module = LoadLibrary("SHELL32.DLL"); if (shell32_module) { p_SHGetFolderPath = (p_SHGetFolderPath_t)