Skip to content

Commit

Permalink
Merge pull request #31 from chertov/master
Browse files Browse the repository at this point in the history
fix windows build, add windows GetDefaultDataDir, add files to project
  • Loading branch information
orignal committed Feb 3, 2014
2 parents c31c1cf + dbd9c5c commit f6e290d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions Streaming.cpp
Expand Up @@ -2,6 +2,7 @@
#include <algorithm>
#include <cryptopp/gzip.h>
#include "Log.h"
#include "I2PEndian.h"
#include "RouterInfo.h"
#include "RouterContext.h"
#include "Tunnel.h"
Expand Down
4 changes: 4 additions & 0 deletions Win32/i2pd.vcxproj
Expand Up @@ -22,6 +22,7 @@
<ClCompile Include="..\Log.cpp" />
<ClCompile Include="..\NetDb.cpp" />
<ClCompile Include="..\NTCPSession.cpp" />
<ClCompile Include="..\Reseed.cpp" />
<ClCompile Include="..\RouterContext.cpp" />
<ClCompile Include="..\RouterInfo.cpp" />
<ClCompile Include="..\SSU.cpp" />
Expand All @@ -31,6 +32,7 @@
<ClCompile Include="..\Tunnel.cpp" />
<ClCompile Include="..\TunnelEndpoint.cpp" />
<ClCompile Include="..\TunnelGateway.cpp" />
<ClCompile Include="..\util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\base64.h" />
Expand All @@ -47,6 +49,7 @@
<ClInclude Include="..\NetDb.h" />
<ClInclude Include="..\NTCPSession.h" />
<ClInclude Include="..\Queue.h" />
<ClInclude Include="..\Reseed.h" />
<ClInclude Include="..\RouterContext.h" />
<ClInclude Include="..\RouterInfo.h" />
<ClInclude Include="..\SSU.h" />
Expand All @@ -59,6 +62,7 @@
<ClInclude Include="..\TunnelConfig.h" />
<ClInclude Include="..\TunnelEndpoint.h" />
<ClInclude Include="..\TunnelGateway.h" />
<ClInclude Include="..\util.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{930568EC-31C9-406A-AD1C-9636DF5D8FAA}</ProjectGuid>
Expand Down
12 changes: 12 additions & 0 deletions Win32/i2pd.vcxproj.filters
Expand Up @@ -75,6 +75,12 @@
<ClCompile Include="..\SSU.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Reseed.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Identity.h">
Expand Down Expand Up @@ -155,5 +161,11 @@
<ClInclude Include="..\SSU.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Reseed.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
10 changes: 9 additions & 1 deletion util.cpp
Expand Up @@ -10,9 +10,15 @@
#include <boost/foreach.hpp>
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/algorithm/string.hpp>
#include "util.h"
#include "Log.h"

#ifdef WIN32
#include <Windows.h>
#include <shlobj.h>
#endif

namespace i2p
{
namespace util
Expand Down Expand Up @@ -152,7 +158,9 @@ namespace filesystem
// Unix: ~/.i2pd
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "i2pd";
char localAppData[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_APPDATA, 0, NULL, localAppData);
return boost::filesystem::path(std::string(localAppData) + "\\i2pd");
#else
boost::filesystem::path pathRet;
char* pszHome = getenv("HOME");
Expand Down

0 comments on commit f6e290d

Please sign in to comment.