winpr: include Windows headers in <winpr/shell.h>

This header file (currently) provides definitions of FILEDESCRIPTOR
structure and GetUserProfileDirectory() function. However, it does so
only when included on non-Windows platforms. The code which includes it
fails to build on Windows because the definitions are absent and it
causes weird compilation errors (like FILEDESCRIPTOR being treated as
the name of a function argument).

Inculde <shlobj.h> to get FILEDESCRIPTOR and <userenv.h> for the
GetUserProfileDirectory() function. (And hope that this will not
pull more Windows headers than we need in the files which include
<winpr/shell.h>.)
This commit is contained in:
ilammy 2017-04-21 00:44:46 +03:00
parent 44b04cafef
commit d341973247

View File

@ -27,7 +27,12 @@
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#ifndef _WIN32
#ifdef _WIN32
#include <shlobj.h>
#include <userenv.h>
#else
/* Shell clipboard formats */