Browse Source

Merge pull request #31 from chertov/master

fix windows build, add windows GetDefaultDataDir, add files to project
pull/33/head
orignal 11 years ago
parent
commit
f6e290d53f
  1. 1
      Streaming.cpp
  2. 4
      Win32/i2pd.vcxproj
  3. 12
      Win32/i2pd.vcxproj.filters
  4. 10
      util.cpp

1
Streaming.cpp

@ -2,6 +2,7 @@ @@ -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"

4
Win32/i2pd.vcxproj

@ -22,6 +22,7 @@ @@ -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" />
@ -31,6 +32,7 @@ @@ -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" />
@ -47,6 +49,7 @@ @@ -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" />
@ -59,6 +62,7 @@ @@ -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>

12
Win32/i2pd.vcxproj.filters

@ -75,6 +75,12 @@ @@ -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">
@ -155,5 +161,11 @@ @@ -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
util.cpp

@ -10,9 +10,15 @@ @@ -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
@ -152,7 +158,9 @@ namespace filesystem @@ -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");

Loading…
Cancel
Save