Skip to content

Commit

Permalink
[win32] CURL: function name is defined on Win32, undef it
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlson2k committed Oct 8, 2013
1 parent c90c0d0 commit 1e3eda6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions xbmc/URL.h
Expand Up @@ -24,6 +24,9 @@

#ifdef TARGET_WINDOWS
#undef SetPort // WIN32INCLUDES this is defined as SetPortA in WinSpool.h which is being included _somewhere_
#ifdef GetUserName
#undef GetUserName
#endif // GetUserName
#endif

class CURL
Expand Down
6 changes: 3 additions & 3 deletions xbmc/filesystem/windows/WINSMBDirectory.cpp
Expand Up @@ -367,13 +367,13 @@ bool CWINSMBDirectory::ConnectToShare(const CURL& url)
while(dwRet != NO_ERROR)
{
strPath = URLEncode(urlIn);
LPCTSTR pUser = urlIn.GetUserNameA().empty() ? NULL : (LPCTSTR)urlIn.GetUserNameA().c_str();
LPCTSTR pUser = urlIn.GetUserName().empty() ? NULL : (LPCTSTR)urlIn.GetUserName().c_str();
LPCTSTR pPass = urlIn.GetPassWord().empty() ? NULL : (LPCTSTR)urlIn.GetPassWord().c_str();
dwRet = WNetAddConnection2(&nr, pPass, pUser, CONNECT_TEMPORARY);
#ifdef _DEBUG
CLog::Log(LOGDEBUG,"Trying to connect to %s with username(%s) and password(%s)", strUNC.c_str(), urlIn.GetUserNameA().c_str(), urlIn.GetPassWord().c_str());
CLog::Log(LOGDEBUG,"Trying to connect to %s with username(%s) and password(%s)", strUNC.c_str(), urlIn.GetUserName().c_str(), urlIn.GetPassWord().c_str());
#else
CLog::Log(LOGDEBUG,"Trying to connect to %s with username(%s) and password(%s)", strUNC.c_str(), urlIn.GetUserNameA().c_str(), "XXXX");
CLog::Log(LOGDEBUG,"Trying to connect to %s with username(%s) and password(%s)", strUNC.c_str(), urlIn.GetUserName().c_str(), "XXXX");
#endif
if(dwRet == ERROR_ACCESS_DENIED || dwRet == ERROR_INVALID_PASSWORD || dwRet == ERROR_LOGON_FAILURE)
{
Expand Down

0 comments on commit 1e3eda6

Please sign in to comment.